Remove unused props parameter from AI spec factories
What does this MR do and why?
This MR removes one unused parameter from a Jest spec factory in 12 spec files under ee/spec/frontend/ai.
In 11 files the parameter is named props. In duo_agentic_chat_state_manager_light_spec.js it is named initialState.
Each factory declared the parameter with an empty object default, such as props = {}, then spread it into propsData or provide:
- const createComponent = ({ props = {}, injectedProps = {} } = {}) => {
+ const createComponent = ({ injectedProps = {} } = {}) => {
wrapper = shallowMount(AiModelsForm, {
provide: {
...injectedProps,
},
- propsData: {
- ...props,
- },No call in the file supplied a value, so the parameter always held an empty object. Spreading an empty object into an object literal adds no keys, so the spread had no effect. Removing the parameter and the spread cannot change what a component receives.
One file needed a second edit. In ai_models_form_spec.js the removed spread was the only content of propsData, so the now-empty block goes too.
No application code changes. Only spec files change.
The cleanup is worth doing because the parameter advertised a control that no test used. A reader cannot tell which factory parameters work without checking every call in the file, and anyone copying the pattern into a new test gets setup that does nothing.
References
- Issue: #631447 (closed)
- Parent epic: gitlab-org#23520
- Predecessor issue, which removed dead feature flags and unused
glFeaturesparameters: #630283 (closed) - Earlier MRs in this issue, both merged: !258711 (merged) and !258712 (merged)
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.