Fix tests which are failing in @vue/test-utils 1.x due to stubs
What does this MR do?
See &4255 (closed) for details Related issue: #240756 (closed)
@vue/test-utils 1.x introduce several changes, which affects our codebase This MR addresses two of them, both stubs related:
- when using
.props()
or.attributes()
, props definition is obtained from stub and not from original component.
For us this means that in 1.x
some calls needs to be either switched from .props()
to .attributes()
when we're querying own stubs (since we're not declaring props on stubs) or props definition needs to be copied from original component (VTU does this internally when defining own stubs for shallowMount
)
- In
1.x
all slots and scoped slots of component are rendered by default. For scoped slots that means that no scope is passed to them, so in some tests we need to do some more stubbing, to ensure we're not trying to render components with incomplete slot data (this is the case forGlFilteredSearch
component, where it's stub tries to render#view
scoped slot by NOT PASSING any value there, so destructuring fails
Screenshots
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines - [-] Style guides
- [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Edited by Illya Klymov