Commit 1e00a8a8 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch '8265-ops-dashboard-intermittent-dashboard-component-karma-failure' into 'master'

Resolve "Ops Dashboard intermittent dashboard component karma failure"

Closes #8265

See merge request gitlab-org/gitlab-ee!8215
parents 2833cc18 4afbb99d
import Vue from 'vue';
import MockAdapter from 'axios-mock-adapter';
import axios from '~/lib/utils/axios_utils';
import store from 'ee/operations/store/index';
import { mountComponentWithStore } from 'spec/helpers/vue_mount_component_helper';
import Dashboard from 'ee/operations/components/dashboard/dashboard.vue';
......@@ -12,24 +14,28 @@ describe('dashboard component', () => {
const ProjectSearchComponent = Vue.extend(ProjectSearch);
const DashboardProjectComponent = Vue.extend(DashboardProject);
const projectTokens = mockProjectData(1);
const mockListPath = 'mock-listPath';
const mount = () =>
mountComponentWithStore(DashboardComponent, {
store,
props: {
addPath: 'mock-addPath',
listPath: 'mock-listPath',
listPath: mockListPath,
emptyDashboardSvgPath: '/assets/illustrations/operations-dashboard_empty.svg',
},
});
let vm;
let mockAxios;
beforeEach(() => {
vm = mount();
mockAxios = new MockAdapter(axios);
});
afterEach(() => {
vm.$destroy();
clearState(store);
mockAxios.restore();
});
it('renders dashboard title', () => {
......@@ -94,11 +100,9 @@ describe('dashboard component', () => {
});
describe('empty state', () => {
beforeAll(done => {
vm.$store
.dispatch('requestProjects')
.then(() => vm.$nextTick(done))
.catch(done.fail);
beforeEach(() => {
mockAxios.onGet(mockListPath).replyOnce(200, { data: [] });
vm = mount();
});
it('renders empty state svg after requesting projects with no results', () => {
......
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