Commit f916ad02 authored by Phil Hughes's avatar Phil Hughes

fixed IDE router push not being spied on

parent 2ca941b5
......@@ -2,6 +2,7 @@ import Vue from 'vue';
import store from 'ee/ide/stores';
import service from 'ee/ide/services';
import modal from 'ee/ide/components/new_dropdown/modal.vue';
import router from 'ee/ide/ide_router';
import { createComponentWithStore } from 'spec/helpers/vue_mount_component_helper';
import { file, resetStore } from '../../helpers';
......@@ -38,6 +39,8 @@ describe('new file modal component', () => {
submodules: [{ name: 'submodule' }],
}),
}));
spyOn(router, 'push');
});
afterEach(() => {
......
......@@ -2,6 +2,7 @@ import Vue from 'vue';
import upload from 'ee/ide/components/new_dropdown/upload.vue';
import store from 'ee/ide/stores';
import service from 'ee/ide/services';
import router from 'ee/ide/ide_router';
import { createComponentWithStore } from 'spec/helpers/vue_mount_component_helper';
import { resetStore } from '../../helpers';
......@@ -38,6 +39,8 @@ describe('new dropdown upload', () => {
}),
}));
spyOn(router, 'push');
const Component = Vue.extend(upload);
store.state.projects.abcproject = {
......
import Vue from 'vue';
import store from 'ee/ide/stores';
import repoTab from 'ee/ide/components/repo_tab.vue';
import router from 'ee/ide/ide_router';
import { file, resetStore } from '../helpers';
describe('RepoTab', () => {
......@@ -15,6 +16,10 @@ describe('RepoTab', () => {
}).$mount();
}
beforeEach(() => {
spyOn(router, 'push');
});
afterEach(() => {
resetStore(vm.$store);
});
......
import Vue from 'vue';
import store from 'ee/ide/stores';
import service from 'ee/ide/services';
import router from 'ee/ide/ide_router';
import { file, resetStore } from '../../helpers';
describe('Multi-file store file actions', () => {
beforeEach(() => {
spyOn(router, 'push');
});
afterEach(() => {
resetStore(store);
});
......
import Vue from 'vue';
import store from 'ee/ide/stores';
import service from 'ee/ide/services';
import router from 'ee/ide/ide_router';
import { file, resetStore } from '../../helpers';
describe('Multi-file store tree actions', () => {
......@@ -13,6 +14,8 @@ describe('Multi-file store tree actions', () => {
};
beforeEach(() => {
spyOn(router, 'push');
store.state.currentProjectId = 'abcproject';
store.state.currentBranchId = 'master';
store.state.projects.abcproject = {
......
import Vue from 'vue';
import * as urlUtils from '~/lib/utils/url_utility';
import store from 'ee/ide/stores';
import router from 'ee/ide/ide_router';
import { resetStore, file } from '../helpers';
describe('Multi-file store actions', () => {
beforeEach(() => {
spyOn(router, 'push');
});
afterEach(() => {
resetStore(store);
});
......
......@@ -7,6 +7,10 @@ import * as consts from 'ee/ide/stores/modules/commit/constants';
import { resetStore, file } from 'spec/ide/helpers';
describe('IDE commit module actions', () => {
beforeEach(() => {
spyOn(router, 'push');
});
afterEach(() => {
resetStore(store);
});
......@@ -170,7 +174,6 @@ describe('IDE commit module actions', () => {
beforeEach(() => {
spyOn(eventHub, '$emit');
spyOn(router, 'push');
f = file('changedFile');
Object.assign(f, {
......@@ -287,7 +290,7 @@ describe('IDE commit module actions', () => {
describe('commitChanges', () => {
beforeEach(() => {
spyOn(router, 'push');
spyOn(urlUtils, 'visitUrl');
document.body.innerHTML += '<div class="flash-container"></div>';
......@@ -380,8 +383,6 @@ describe('IDE commit module actions', () => {
});
it('redirects to new merge request page', (done) => {
spyOn(urlUtils, 'visitUrl');
store.state.commit.commitAction = '3';
store.dispatch('commit/commitChanges')
......
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