Commit c6696389 authored by Phil Hughes's avatar Phil Hughes

fixed specs

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