Commit ad8d93e5 authored by Florie Guibert's avatar Florie Guibert

Add issue board sidebar test in board_content spec

parent f842475e
...@@ -7,6 +7,7 @@ import EpicsSwimlanes from 'ee_component/boards/components/epics_swimlanes.vue'; ...@@ -7,6 +7,7 @@ import EpicsSwimlanes from 'ee_component/boards/components/epics_swimlanes.vue';
import getters from 'ee_else_ce/boards/stores/getters'; import getters from 'ee_else_ce/boards/stores/getters';
import BoardColumn from '~/boards/components/board_column.vue'; import BoardColumn from '~/boards/components/board_column.vue';
import BoardContent from '~/boards/components/board_content.vue'; import BoardContent from '~/boards/components/board_content.vue';
import BoardContentSidebar from '~/boards/components/board_content_sidebar.vue';
import { mockLists, mockListsWithModel } from '../mock_data'; import { mockLists, mockListsWithModel } from '../mock_data';
Vue.use(Vuex); Vue.use(Vuex);
...@@ -23,6 +24,7 @@ describe('BoardContent', () => { ...@@ -23,6 +24,7 @@ describe('BoardContent', () => {
isShowingEpicsSwimlanes: false, isShowingEpicsSwimlanes: false,
boardLists: mockLists, boardLists: mockLists,
error: undefined, error: undefined,
issuableType: 'issue',
}; };
const createStore = (state = defaultState) => { const createStore = (state = defaultState) => {
...@@ -51,21 +53,37 @@ describe('BoardContent', () => { ...@@ -51,21 +53,37 @@ describe('BoardContent', () => {
}); });
}; };
beforeEach(() => {
createComponent();
});
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
}); });
it('renders a BoardColumn component per list', () => { describe('default', () => {
expect(wrapper.findAllComponents(BoardColumn)).toHaveLength(mockListsWithModel.length); beforeEach(() => {
createComponent();
});
it('renders a BoardColumn component per list', () => {
expect(wrapper.findAllComponents(BoardColumn)).toHaveLength(mockListsWithModel.length);
});
it('renders BoardContentSidebar', () => {
expect(wrapper.find(BoardContentSidebar).exists()).toBe(true);
});
it('does not display EpicsSwimlanes component', () => {
expect(wrapper.find(EpicsSwimlanes).exists()).toBe(false);
expect(wrapper.find(GlAlert).exists()).toBe(false);
});
}); });
it('does not display EpicsSwimlanes component', () => { describe('when issuableType is not issue', () => {
expect(wrapper.find(EpicsSwimlanes).exists()).toBe(false); beforeEach(() => {
expect(wrapper.find(GlAlert).exists()).toBe(false); createComponent({ state: { issuableType: 'foo' } });
});
it('does not render BoardContentSidebar', () => {
expect(wrapper.find(BoardContentSidebar).exists()).toBe(false);
});
}); });
describe('can admin list', () => { describe('can admin list', () => {
......
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