diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-03 09:09:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-03 09:09:25 +0300 |
commit | fdc5404bc3391e9a767b2a32422c082b9490c663 (patch) | |
tree | 207f06660ed46b8eb0f02ef0e3f70795723db158 /spec/frontend/boards/components | |
parent | ef354fba59ddfcebdb2f539064e55d95d27e15b8 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/boards/components')
-rw-r--r-- | spec/frontend/boards/components/board_content_spec.js | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/spec/frontend/boards/components/board_content_spec.js b/spec/frontend/boards/components/board_content_spec.js index bbda544367b..a4cb2de71f4 100644 --- a/spec/frontend/boards/components/board_content_spec.js +++ b/spec/frontend/boards/components/board_content_spec.js @@ -7,6 +7,7 @@ import EpicsSwimlanes from 'ee_component/boards/components/epics_swimlanes.vue'; import getters from 'ee_else_ce/boards/stores/getters'; import BoardColumn from '~/boards/components/board_column.vue'; import BoardContent from '~/boards/components/board_content.vue'; +import BoardContentSidebar from '~/boards/components/board_content_sidebar.vue'; import { mockLists, mockListsWithModel } from '../mock_data'; Vue.use(Vuex); @@ -23,6 +24,7 @@ describe('BoardContent', () => { isShowingEpicsSwimlanes: false, boardLists: mockLists, error: undefined, + issuableType: 'issue', }; const createStore = (state = defaultState) => { @@ -51,21 +53,37 @@ describe('BoardContent', () => { }); }; - beforeEach(() => { - createComponent(); - }); - afterEach(() => { wrapper.destroy(); }); - it('renders a BoardColumn component per list', () => { - expect(wrapper.findAllComponents(BoardColumn)).toHaveLength(mockListsWithModel.length); + describe('default', () => { + 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', () => { - expect(wrapper.find(EpicsSwimlanes).exists()).toBe(false); - expect(wrapper.find(GlAlert).exists()).toBe(false); + describe('when issuableType is not issue', () => { + beforeEach(() => { + createComponent({ state: { issuableType: 'foo' } }); + }); + + it('does not render BoardContentSidebar', () => { + expect(wrapper.find(BoardContentSidebar).exists()).toBe(false); + }); }); describe('can admin list', () => { |