Commit c6696389 authored by Phil Hughes's avatar Phil Hughes

fixed specs

parent 5c8f31eb
...@@ -15,9 +15,7 @@ describe('IDE commit sidebar actions', () => { ...@@ -15,9 +15,7 @@ describe('IDE commit sidebar actions', () => {
vm.$store.state.currentBranchId = 'master'; vm.$store.state.currentBranchId = 'master';
vm.$store.state.currentProjectId = 'abcproject'; vm.$store.state.currentProjectId = 'abcproject';
vm.$store.state.projects.abcproject = { Vue.set(vm.$store.state.projects, 'abcproject', { ...projectData });
...projectData,
};
vm.$mount(); vm.$mount();
...@@ -39,12 +37,8 @@ describe('IDE commit sidebar actions', () => { ...@@ -39,12 +37,8 @@ describe('IDE commit sidebar actions', () => {
}); });
it('hides merge request option when project merge requests are disabled', done => { it('hides merge request option when project merge requests are disabled', done => {
vm.$destroy();
vm.$store.state.projects.abcproject.merge_requests_enabled = false; vm.$store.state.projects.abcproject.merge_requests_enabled = false;
vm.$mount();
vm.$nextTick(() => { vm.$nextTick(() => {
expect(vm.$el.querySelectorAll('input[type="radio"]').length).toBe(2); expect(vm.$el.querySelectorAll('input[type="radio"]').length).toBe(2);
expect(vm.$el.textContent).not.toContain('Create a new branch and merge request'); expect(vm.$el.textContent).not.toContain('Create a new branch and merge request');
......
...@@ -4,6 +4,7 @@ import CommitForm from '~/ide/components/commit_sidebar/form.vue'; ...@@ -4,6 +4,7 @@ import CommitForm from '~/ide/components/commit_sidebar/form.vue';
import { activityBarViews } from '~/ide/constants'; import { activityBarViews } from '~/ide/constants';
import { createComponentWithStore } from 'spec/helpers/vue_mount_component_helper'; import { createComponentWithStore } from 'spec/helpers/vue_mount_component_helper';
import getSetTimeoutPromise from 'spec/helpers/set_timeout_promise_helper'; import getSetTimeoutPromise from 'spec/helpers/set_timeout_promise_helper';
import { projectData } from 'spec/ide/mock_data';
import { resetStore } from '../../helpers'; import { resetStore } from '../../helpers';
describe('IDE commit form', () => { describe('IDE commit form', () => {
...@@ -14,6 +15,8 @@ describe('IDE commit form', () => { ...@@ -14,6 +15,8 @@ describe('IDE commit form', () => {
spyOnProperty(window, 'innerHeight').and.returnValue(800); spyOnProperty(window, 'innerHeight').and.returnValue(800);
store.state.changedFiles.push('test'); store.state.changedFiles.push('test');
store.state.currentProjectId = 'abcproject';
Vue.set(store.state.projects, 'abcproject', { ...projectData });
vm = createComponentWithStore(Component, store).$mount(); vm = createComponentWithStore(Component, store).$mount();
}); });
......
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