Commit 1e3a3618 authored by Phil Hughes's avatar Phil Hughes

fixed ide_spec.js

parent 8673a2ca
...@@ -3,6 +3,7 @@ import store from '~/ide/stores'; ...@@ -3,6 +3,7 @@ import store from '~/ide/stores';
import ide from '~/ide/components/ide.vue'; import ide from '~/ide/components/ide.vue';
import { createComponentWithStore } from 'spec/helpers/vue_mount_component_helper'; import { createComponentWithStore } from 'spec/helpers/vue_mount_component_helper';
import { file, resetStore } from '../helpers'; import { file, resetStore } from '../helpers';
import { projectData } from '../mock_data';
describe('ide component', () => { describe('ide component', () => {
let vm; let vm;
...@@ -10,6 +11,10 @@ describe('ide component', () => { ...@@ -10,6 +11,10 @@ describe('ide component', () => {
beforeEach(() => { beforeEach(() => {
const Component = Vue.extend(ide); const Component = Vue.extend(ide);
store.state.currentProjectId = 'abcproject';
store.state.currentBranchId = 'master';
store.state.projects.abcproject = Object.assign({}, projectData);
vm = createComponentWithStore(Component, store, { vm = createComponentWithStore(Component, store, {
emptyStateSvgPath: 'svg', emptyStateSvgPath: 'svg',
noChangesStateSvgPath: 'svg', noChangesStateSvgPath: 'svg',
...@@ -23,11 +28,11 @@ describe('ide component', () => { ...@@ -23,11 +28,11 @@ describe('ide component', () => {
resetStore(vm.$store); resetStore(vm.$store);
}); });
it('does not render panel right when no files open', () => { it('does not render right right when no files open', () => {
expect(vm.$el.querySelector('.panel-right')).toBeNull(); expect(vm.$el.querySelector('.panel-right')).toBeNull();
}); });
it('renders panel right when files are open', done => { it('renders right panel when files are open', done => {
vm.$store.state.trees['abcproject/mybranch'] = { vm.$store.state.trees['abcproject/mybranch'] = {
tree: [file()], tree: [file()],
}; };
......
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