Remove unused glFeatures parameter from policy editor specs

What does this MR do and why?

This MR removes an unused glFeatures factory parameter from 12 Jest spec files. All 12 files are under ee/spec/frontend/security_orchestration/. This MR does not change any application code.

Each file declares the parameter with an empty default value:

const createWrapper = ({ propsData = {}, provide = {}, glFeatures = {} } = {}) => {

No call in any of the 12 files supplies a value for the parameter. The value is always an empty object. The provide entry that receives it 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 may copy the parameter to add a flag test. The copy will not work. CI cannot catch this problem. The tests pass whether the parameter stays or is removed.

Ten files pass the parameter straight into provide as glFeatures,. Two files spread it as glFeatures: { ...glFeatures }. This MR removes both forms. The ...provide spread next to it stays. A caller can still provide other values.

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

This is the third merge request for the issue below. Earlier merge requests:

  • !256955 (merged) removed dead flags from the security and work item areas.
  • The second merge request removed dead flags from the remaining areas.

Why removing the provide entry is safe

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

One file this MR leaves out

The issue lists 13 files. This MR touches 12 of them. The 13th file is ee/spec/frontend/security_orchestration/components/policy_editor/dependency_firewall/editor_component_spec.js.

That file also has a glFeatures parameter that no call supplies. It differs from the other 12 files. Its default value is not empty:

const createWrapper = (propsData = {}, glFeatures = { dependencyFirewallPhase2: true }) => {

dependency_firewall_phase2 is a live feature flag. A YAML file for it exists under config/feature_flags/wip/. ee/app/controllers/groups/security/policies_controller.rb pushes the flag. editor_component.vue reads the flag. Removing the parameter here means writing the value in place. It is not just deleting setup code. That is a different change. It belongs in its own merge request.

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 evaluated this MR against the acceptance checklist.

🤖 AI-generated

Edited by Justin Ho Tuan Duong

Merge request reports

Loading
Loading