summaryrefslogtreecommitdiff
path: root/spec/frontend/monitoring/components/dashboard_template_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/monitoring/components/dashboard_template_spec.js')
-rw-r--r--spec/frontend/monitoring/components/dashboard_template_spec.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/frontend/monitoring/components/dashboard_template_spec.js b/spec/frontend/monitoring/components/dashboard_template_spec.js
index cc0ac348b11..a1a450d4abe 100644
--- a/spec/frontend/monitoring/components/dashboard_template_spec.js
+++ b/spec/frontend/monitoring/components/dashboard_template_spec.js
@@ -2,6 +2,7 @@ import { shallowMount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter';
import axios from '~/lib/utils/axios_utils';
import Dashboard from '~/monitoring/components/dashboard.vue';
+import DashboardHeader from '~/monitoring/components/dashboard_header.vue';
import { createStore } from '~/monitoring/stores';
import { setupAllDashboards } from '../store_utils';
import { propsData } from '../mock_data';
@@ -14,7 +15,9 @@ describe('Dashboard template', () => {
let mock;
beforeEach(() => {
- store = createStore();
+ store = createStore({
+ currentEnvironmentName: 'production',
+ });
mock = new MockAdapter(axios);
setupAllDashboards(store);
@@ -25,7 +28,13 @@ describe('Dashboard template', () => {
});
it('matches the default snapshot', () => {
- wrapper = shallowMount(Dashboard, { propsData: { ...propsData }, store });
+ wrapper = shallowMount(Dashboard, {
+ propsData: { ...propsData },
+ store,
+ stubs: {
+ DashboardHeader,
+ },
+ });
expect(wrapper.element).toMatchSnapshot();
});