Commit 58f0cc51 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'ee-monitoring-dashboard-spec' into 'master'

Fix failing EE component spec

Closes #11791

See merge request gitlab-org/gitlab-ee!13459
parents 0618c2ae 0b62340c
...@@ -2,6 +2,7 @@ import { shallowMount, createLocalVue } from '@vue/test-utils'; ...@@ -2,6 +2,7 @@ import { shallowMount, createLocalVue } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import { GlModal } from '@gitlab/ui'; import { GlModal } from '@gitlab/ui';
import Dashboard from 'ee/monitoring/components/dashboard.vue'; import Dashboard from 'ee/monitoring/components/dashboard.vue';
import { createStore } from '~/monitoring/stores';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { metricsGroupsAPIResponse, mockApiEndpoint } from 'spec/monitoring/mock_data'; import { metricsGroupsAPIResponse, mockApiEndpoint } from 'spec/monitoring/mock_data';
import propsData from 'spec/monitoring/dashboard_spec'; import propsData from 'spec/monitoring/dashboard_spec';
...@@ -11,6 +12,7 @@ import CustomMetricsFormFields from 'ee/custom_metrics/components/custom_metrics ...@@ -11,6 +12,7 @@ import CustomMetricsFormFields from 'ee/custom_metrics/components/custom_metrics
describe('Dashboard', () => { describe('Dashboard', () => {
let Component; let Component;
let mock; let mock;
let store;
let vm; let vm;
const localVue = createLocalVue(); const localVue = createLocalVue();
...@@ -25,6 +27,7 @@ describe('Dashboard', () => { ...@@ -25,6 +27,7 @@ describe('Dashboard', () => {
ee: true, ee: true,
}; };
store = createStore();
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
mock.onGet(mockApiEndpoint).reply(200, metricsGroupsAPIResponse); mock.onGet(mockApiEndpoint).reply(200, metricsGroupsAPIResponse);
Component = localVue.extend(Dashboard); Component = localVue.extend(Dashboard);
...@@ -45,6 +48,7 @@ describe('Dashboard', () => { ...@@ -45,6 +48,7 @@ describe('Dashboard', () => {
alertsEndpoint: '/endpoint', alertsEndpoint: '/endpoint',
showTimeWindowDropdown: false, showTimeWindowDropdown: false,
}, },
store,
}); });
}); });
...@@ -66,6 +70,7 @@ describe('Dashboard', () => { ...@@ -66,6 +70,7 @@ describe('Dashboard', () => {
alertsEndpoint: '/endpoint', alertsEndpoint: '/endpoint',
showTimeWindowDropdown: false, showTimeWindowDropdown: false,
}, },
store,
}); });
}); });
...@@ -91,6 +96,7 @@ describe('Dashboard', () => { ...@@ -91,6 +96,7 @@ describe('Dashboard', () => {
alertsEndpoint: '/endpoint', alertsEndpoint: '/endpoint',
showTimeWindowDropdown: false, showTimeWindowDropdown: false,
}, },
store,
}); });
}); });
...@@ -114,6 +120,7 @@ describe('Dashboard', () => { ...@@ -114,6 +120,7 @@ describe('Dashboard', () => {
alertsEndpoint: '/endpoint', alertsEndpoint: '/endpoint',
showTimeWindowDropdown: false, showTimeWindowDropdown: false,
}, },
store,
}); });
setTimeout(done); setTimeout(done);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment