Several tests are breaking due to shallowMount + stubs changes in @vue/test-utils 1.0.0-beta.30
@vue/test-utils
1.0.0-beta.30 changed shallowMount + stubs logic:
Assume we have component Main
, which renders childs GLTable
and GlLoadingIcon
.
In beta.25
if we pass GlTable
to stubs
, all dependencies of GlTable (for example BTable
which is used in GlTable
underneath) are also rendered, while in beta.30
this behavior was fixed, and they are properly stubbed
graph TB
subgraph After
A-M[Main] --> A-T[GlTable]
A-M --> A-L[GlLoadingIcon]
A-T --> A-U[BTable]
end
subgraph Before
B-M[Main] --> B-T[GlTable]
B-M --> B-L[GlLoadingIcon]
B-T --> B-U[BTable]
end
classDef green fill:#9f6
classDef orange fill:#f96
class B-T,B-U,A-T green
class B-L,A-L,A-U orange
- green - really rendered components
- orange - components stubbed by
shallowMount
Failing files:
ee/spec/frontend/packages/list/components/packages_list_spec.js
ee/spec/frontend/security_dashboard/components/vulnerability_chart_spec.js
spec/frontend/error_tracking/components/error_tracking_list_spec.js
spec/frontend/pages/admin/users/components/user_modal_manager_spec.js