summaryrefslogtreecommitdiff
path: root/spec/frontend/monitoring/components/group_empty_state_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/monitoring/components/group_empty_state_spec.js')
-rw-r--r--spec/frontend/monitoring/components/group_empty_state_spec.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/spec/frontend/monitoring/components/group_empty_state_spec.js b/spec/frontend/monitoring/components/group_empty_state_spec.js
index 3b94c4c6806..4a550efe23c 100644
--- a/spec/frontend/monitoring/components/group_empty_state_spec.js
+++ b/spec/frontend/monitoring/components/group_empty_state_spec.js
@@ -1,13 +1,9 @@
import { GlEmptyState } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
+import { stubComponent } from 'helpers/stub_component';
import GroupEmptyState from '~/monitoring/components/group_empty_state.vue';
import { metricStates } from '~/monitoring/constants';
-const MockGlEmptyState = {
- props: GlEmptyState.props,
- template: '<div><slot name="description"></slot></div>',
-};
-
function createComponent(props) {
return shallowMount(GroupEmptyState, {
propsData: {
@@ -17,7 +13,9 @@ function createComponent(props) {
svgPath: '/path/to/empty-group-illustration.svg',
},
stubs: {
- GlEmptyState: MockGlEmptyState,
+ GlEmptyState: stubComponent(GlEmptyState, {
+ template: '<div><slot name="description"></slot></div>',
+ }),
},
});
}
@@ -47,7 +45,7 @@ describe('GroupEmptyState', () => {
});
it('passes the expected props to GlEmptyState', () => {
- expect(wrapper.find(MockGlEmptyState).props()).toMatchSnapshot();
+ expect(wrapper.find(GlEmptyState).props()).toMatchSnapshot();
});
});
});