diff options
Diffstat (limited to 'spec/frontend/boards/components')
8 files changed, 23 insertions, 24 deletions
diff --git a/spec/frontend/boards/components/board_card_spec.js b/spec/frontend/boards/components/board_card_spec.js index 71a10fe7114..cd3882dc9ee 100644 --- a/spec/frontend/boards/components/board_card_spec.js +++ b/spec/frontend/boards/components/board_card_spec.js @@ -29,9 +29,6 @@ describe('Board card', () => { ...initialState, }, actions: mockActions, - getters: { - isProjectBoard: () => false, - }, }); }; @@ -62,6 +59,8 @@ describe('Board card', () => { scopedLabelsAvailable: false, isEpicBoard: false, issuableType: 'issue', + isProjectBoard: false, + isGroupBoard: true, ...provide, }, }); diff --git a/spec/frontend/boards/components/board_content_sidebar_spec.js b/spec/frontend/boards/components/board_content_sidebar_spec.js index cab00390901..51c42b48535 100644 --- a/spec/frontend/boards/components/board_content_sidebar_spec.js +++ b/spec/frontend/boards/components/board_content_sidebar_spec.js @@ -34,7 +34,6 @@ describe('BoardContentSidebar', () => { groupPathForActiveIssue: () => mockIssueGroupPath, projectPathForActiveIssue: () => mockIssueProjectPath, isSidebarOpen: () => true, - isGroupBoard: () => false, ...mockGetters, }, actions: mockActions, @@ -55,6 +54,7 @@ describe('BoardContentSidebar', () => { rootPath: '/', groupId: 1, issuableType: issuableTypes.issue, + isGroupBoard: false, }, store, stubs: { diff --git a/spec/frontend/boards/components/board_content_spec.js b/spec/frontend/boards/components/board_content_spec.js index 82e7ab48e7d..98f66ed804a 100644 --- a/spec/frontend/boards/components/board_content_spec.js +++ b/spec/frontend/boards/components/board_content_spec.js @@ -71,6 +71,7 @@ describe('BoardContent', () => { issuableType, isIssueBoard, isEpicBoard, + isGroupBoard: true, isApolloBoard, }, store, diff --git a/spec/frontend/boards/components/board_form_spec.js b/spec/frontend/boards/components/board_form_spec.js index fdc16b46167..f8154145d43 100644 --- a/spec/frontend/boards/components/board_form_spec.js +++ b/spec/frontend/boards/components/board_form_spec.js @@ -53,10 +53,6 @@ describe('BoardForm', () => { const setErrorMock = jest.fn(); const store = new Vuex.Store({ - getters: { - isGroupBoard: () => true, - isProjectBoard: () => false, - }, actions: { setBoard: setBoardMock, setError: setErrorMock, @@ -73,6 +69,8 @@ describe('BoardForm', () => { }, provide: { boardBaseUrl: 'root', + isGroupBoard: true, + isProjectBoard: false, }, mocks: { $apollo: { diff --git a/spec/frontend/boards/components/board_new_issue_spec.js b/spec/frontend/boards/components/board_new_issue_spec.js index 398caa4de62..c3e69ba0e40 100644 --- a/spec/frontend/boards/components/board_new_issue_spec.js +++ b/spec/frontend/boards/components/board_new_issue_spec.js @@ -16,7 +16,8 @@ const mockActions = { addListNewIssue: addListNewIssuesSpy }; const createComponent = ({ state = { selectedProject: mockGroupProjects[0] }, actions = mockActions, - getters = { isGroupBoard: () => true, getBoardItemsByList: () => () => [] }, + getters = { getBoardItemsByList: () => () => [] }, + isGroupBoard = true, } = {}) => shallowMount(BoardNewIssue, { store: new Vuex.Store({ @@ -32,6 +33,7 @@ const createComponent = ({ fullPath: mockGroupProjects[0].fullPath, weightFeatureAvailable: false, boardWeight: null, + isGroupBoard, }, stubs: { BoardNewItem, @@ -85,9 +87,9 @@ describe('Issue boards new issue form', () => { beforeEach(() => { wrapper = createComponent({ getters: { - isGroupBoard: () => true, getBoardItemsByList: () => () => [mockIssue, mockIssue2], }, + isGroupBoard: true, }); }); @@ -129,7 +131,7 @@ describe('Issue boards new issue form', () => { describe('when in project issue board', () => { beforeEach(() => { wrapper = createComponent({ - getters: { isGroupBoard: () => false }, + isGroupBoard: false, }); }); diff --git a/spec/frontend/boards/components/board_top_bar_spec.js b/spec/frontend/boards/components/board_top_bar_spec.js index 08b5042f70f..af492145eb0 100644 --- a/spec/frontend/boards/components/board_top_bar_spec.js +++ b/spec/frontend/boards/components/board_top_bar_spec.js @@ -33,6 +33,7 @@ describe('BoardTopBar', () => { boardType: 'group', releasesFetchPath: '/releases', isIssueBoard: true, + isGroupBoard: true, ...provide, }, stubs: { IssueBoardFilteredSearch }, diff --git a/spec/frontend/boards/components/boards_selector_spec.js b/spec/frontend/boards/components/boards_selector_spec.js index 9f7d36330b0..7b61ca5e6fd 100644 --- a/spec/frontend/boards/components/boards_selector_spec.js +++ b/spec/frontend/boards/components/boards_selector_spec.js @@ -10,7 +10,6 @@ import groupBoardsQuery from '~/boards/graphql/group_boards.query.graphql'; import projectBoardsQuery from '~/boards/graphql/project_boards.query.graphql'; import groupRecentBoardsQuery from '~/boards/graphql/group_recent_boards.query.graphql'; import projectRecentBoardsQuery from '~/boards/graphql/project_recent_boards.query.graphql'; -import defaultStore from '~/boards/stores'; import createMockApollo from 'helpers/mock_apollo_helper'; import { mountExtended } from 'helpers/vue_test_utils_helper'; import { @@ -28,23 +27,19 @@ import { const throttleDuration = 1; Vue.use(VueApollo); +Vue.use(Vuex); describe('BoardsSelector', () => { let wrapper; let fakeApollo; let store; - const createStore = ({ isGroupBoard = false, isProjectBoard = false } = {}) => { + const createStore = () => { store = new Vuex.Store({ - ...defaultStore, actions: { setError: jest.fn(), setBoardConfig: jest.fn(), }, - getters: { - isGroupBoard: () => isGroupBoard, - isProjectBoard: () => isProjectBoard, - }, state: { board: mockBoard, }, @@ -86,6 +81,7 @@ describe('BoardsSelector', () => { projectBoardsQueryHandler = projectBoardsQueryHandlerSuccess, projectRecentBoardsQueryHandler = projectRecentBoardsQueryHandlerSuccess, isGroupBoard = false, + isProjectBoard = false, } = {}) => { fakeApollo = createMockApollo([ [projectBoardsQuery, projectBoardsQueryHandler], @@ -110,6 +106,8 @@ describe('BoardsSelector', () => { scopedIssueBoardFeatureEnabled: true, weights: [], boardType: isGroupBoard ? 'group' : 'project', + isGroupBoard, + isProjectBoard, }, }); }; @@ -121,8 +119,8 @@ describe('BoardsSelector', () => { describe('template', () => { beforeEach(() => { - createStore({ isProjectBoard: true }); - createComponent(); + createStore(); + createComponent({ isProjectBoard: true }); }); describe('loading', () => { @@ -230,11 +228,11 @@ describe('BoardsSelector', () => { ${BoardType.group} | ${groupBoardsQueryHandlerSuccess} | ${projectBoardsQueryHandlerSuccess} ${BoardType.project} | ${projectBoardsQueryHandlerSuccess} | ${groupBoardsQueryHandlerSuccess} `('fetches $boardType boards', async ({ boardType, queryHandler, notCalledHandler }) => { - createStore({ - isProjectBoard: boardType === BoardType.project, + createStore(); + createComponent({ isGroupBoard: boardType === BoardType.group, + isProjectBoard: boardType === BoardType.project, }); - createComponent({ isGroupBoard: boardType === BoardType.group }); await nextTick(); diff --git a/spec/frontend/boards/components/issue_board_filtered_search_spec.js b/spec/frontend/boards/components/issue_board_filtered_search_spec.js index 513561307cd..57a30ddc512 100644 --- a/spec/frontend/boards/components/issue_board_filtered_search_spec.js +++ b/spec/frontend/boards/components/issue_board_filtered_search_spec.js @@ -18,7 +18,7 @@ describe('IssueBoardFilter', () => { isSignedIn, releasesFetchPath: '/releases', fullPath: 'gitlab-org', - boardType: 'group', + isGroupBoard: true, }, }); }; |