Remove unused feature flag parameter from six specs

What does this MR do and why?

This MR removes an unused glFeatures or features factory parameter from 6 Jest spec files. It makes no application code changes.

Each file declares the parameter with an empty default. No call in the file supplies a value. The value is always an empty object. The provide entry it feeds never carries a feature flag.

The parameter looks like a way to drive the component under test with a feature flag. It is not. A reader who wants to add a flag test can copy it and expect it to work. That expectation is wrong. CI cannot catch this problem. The tests pass whether the parameter stays or goes.

This MR follows the pattern described in this discussion: !256677 (comment 3882984375)

The 6 files, and what each edit leaves behind

The parameter is removed in every file. What sits next to it differs. The edits are not all the same shape.

  1. spec/frontend/notes/components/comment_form_spec.js — features was the only content of the provide block. The block is removed.
  2. ee/spec/frontend/notes/components/comment_form_spec.js — features shared the provide block with glAbilities. Only the glFeatures line is removed.
  3. spec/frontend/security_configuration/components/app_spec.js — the glFeatures object also holds vulnerabilitiesAcrossContexts, which callers do supply. Only the ...glFeatures spread is removed. The object stays.
  4. ee/spec/frontend/ai/catalog/components/ai_catalog_item_actions_spec.js — the parameter fed the Vue Test Utils mocks option, not provide. The mocks block keeps $route and $router. Other mount calls in this file set their own glFeatures and are not touched.
  5. ee/spec/frontend/billings/pricing_information/components/premium_plan_section_spec.js — glFeatures was the only content of the provide block. The block is removed.
  6. ee/spec/frontend/pages/projects/get_started/components/get_familiar_spec.js — glFeatures was the only content of the provide block, and the block was the only mount option. The factory now takes no arguments. It mounts the component directly.

Why removing a provide entry is safe

glFeatureFlagsMixin injects glFeatures with a default of an empty object. 238 components use the mixin. One component injects glFeatures without a default: app/assets/javascripts/vue_shared/components/source_viewer/components/chunk.vue. No spec in this change mounts that component.

Case 4 is safe for the same reason. The mocks option set this.glFeatures directly. With it removed, the component falls back to the mixin default.

References

Screenshots or screen recordings

This MR changes only spec files. There is no UI change to show.

How to set up and validate locally

There is nothing to set up. This MR changes only spec files. CI runs the Jest suites in both Vue lanes.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

  • I have evaluated this MR against the acceptance checklist.

🤖 AI-generated

Edited by Justin Ho Tuan Duong

Merge request reports

Loading
Loading