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.
spec/frontend/notes/components/comment_form_spec.js—featureswas the only content of theprovideblock. The block is removed.ee/spec/frontend/notes/components/comment_form_spec.js—featuresshared theprovideblock withglAbilities. Only theglFeaturesline is removed.spec/frontend/security_configuration/components/app_spec.js— theglFeaturesobject also holdsvulnerabilitiesAcrossContexts, which callers do supply. Only the...glFeaturesspread is removed. The object stays.ee/spec/frontend/ai/catalog/components/ai_catalog_item_actions_spec.js— the parameter fed the Vue Test Utilsmocksoption, notprovide. Themocksblock keeps$routeand$router. Other mount calls in this file set their ownglFeaturesand are not touched.ee/spec/frontend/billings/pricing_information/components/premium_plan_section_spec.js—glFeatureswas the only content of theprovideblock. The block is removed.ee/spec/frontend/pages/projects/get_started/components/get_familiar_spec.js—glFeatureswas the only content of theprovideblock, 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
- Issue: #630283 (closed)
- Epic: &23520
- First merge request in this series: !256955 (merged)
- Second merge request: !257192 (merged)
- Originating discussion: !256677 (comment 3882984375)
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.