Remove unused props parameter from work item spec factories
What does this MR do and why?
This merge request removes an unused props parameter from a Jest spec factory in 11 spec files under spec/frontend/work_items and ee/spec/frontend/work_items.
Each factory declared the parameter with an empty object default, props = {}. The factory then spread the parameter into a propsData object. No call in the file supplied a value for the parameter. The parameter always held an empty object.
Spreading an empty object into an object literal adds no keys. So the spread had no effect. The change removes the parameter and the spread. It cannot change what a component receives. No application code changes. Only spec files change.
The cleanup is worth doing for three reasons. The parameter advertised a control that no test used. A reader cannot tell which factory parameters work. The reader must check every call in the file. Somebody who copies the pattern into a new test gets setup that does nothing.
- const createComponent = ({ props = {} } = {}) => {
+ const createComponent = () => {
wrapper = shallowMountExtended(BoardColumnCount, {
propsData: {
strategy: mockStrategy,
rootPageFullPath: 'full/path',
- ...props,
},Two diffs are larger than two lines. Prettier collapsed a multi-line factory signature onto one line after the parameter went. The files are spec/frontend/work_items/list/components/work_items_saved_views_limit_warning_modal_spec.js and ee/spec/frontend/work_items/list/components/list_view_spec.js.
References
- Issue: #631447 (closed)
- Parent epic: gitlab-org#23520
- Predecessor issue, which removed dead feature flags and unused
glFeaturesparameters: #630283 (closed) - Originating discussion: !256677 (comment 3882984375)
This merge request covers the work_items spec trees. A sibling merge request covers the ci spec trees: !258711 (merged)
How to set up and validate locally
There is nothing to set up, because this merge request changes only spec files. CI runs the Jest suites in both Vue lanes.