diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
commit | 5afcbe03ead9ada87621888a31a62652b10a7e4f (patch) | |
tree | 9918b67a0d0f0bafa6542e839a8be37adf73102d /spec/frontend/boards | |
parent | c97c0201564848c1f53226fe19d71fdcc472f7d0 (diff) |
Add latest changes from gitlab-org/gitlab@16-4-stable-eev16.4.0-rc42
Diffstat (limited to 'spec/frontend/boards')
6 files changed, 24 insertions, 10 deletions
diff --git a/spec/frontend/boards/board_card_inner_spec.js b/spec/frontend/boards/board_card_inner_spec.js index 1740676161f..95b5712bab0 100644 --- a/spec/frontend/boards/board_card_inner_spec.js +++ b/spec/frontend/boards/board_card_inner_spec.js @@ -91,6 +91,7 @@ describe('Board card component', () => { rootPath: '/', scopedLabelsAvailable: false, isEpicBoard, + allowSubEpics: isEpicBoard, issuableType: TYPE_ISSUE, isGroupBoard, isApolloBoard: false, diff --git a/spec/frontend/boards/components/board_card_spec.js b/spec/frontend/boards/components/board_card_spec.js index 167efb94fcc..f0d40af94fe 100644 --- a/spec/frontend/boards/components/board_card_spec.js +++ b/spec/frontend/boards/components/board_card_spec.js @@ -72,6 +72,7 @@ describe('Board card', () => { issuableType: 'issue', isGroupBoard: true, disabled: false, + allowSubEpics: false, isApolloBoard: false, ...provide, }, diff --git a/spec/frontend/boards/components/boards_selector_spec.js b/spec/frontend/boards/components/boards_selector_spec.js index b17a5589c07..fa18b47cf54 100644 --- a/spec/frontend/boards/components/boards_selector_spec.js +++ b/spec/frontend/boards/components/boards_selector_spec.js @@ -87,6 +87,7 @@ describe('BoardsSelector', () => { isGroupBoard = false, isProjectBoard = false, provide = {}, + props = {}, } = {}) => { fakeApollo = createMockApollo([ [projectBoardsQuery, projectBoardsQueryHandler], @@ -100,6 +101,7 @@ describe('BoardsSelector', () => { apolloProvider: fakeApollo, propsData: { throttleDuration, + ...props, }, attachTo: document.body, provide: { @@ -307,4 +309,14 @@ describe('BoardsSelector', () => { }); }); }); + + describe('Apollo boards', () => { + it('displays loading state of dropdown while current board is being fetched', () => { + createComponent({ + props: { isCurrentBoardLoading: true }, + provide: { isApolloBoard: true }, + }); + expect(findDropdown().props('loading')).toBe(true); + }); + }); }); 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 5b5b68d5dbe..16ad54f0854 100644 --- a/spec/frontend/boards/components/issue_board_filtered_search_spec.js +++ b/spec/frontend/boards/components/issue_board_filtered_search_spec.js @@ -61,12 +61,7 @@ describe('IssueBoardFilter', () => { ({ isSignedIn }) => { createComponent({ isSignedIn }); - const tokens = mockTokens( - fetchLabelsSpy, - fetchUsersSpy, - wrapper.vm.fetchMilestones, - isSignedIn, - ); + const tokens = mockTokens(fetchLabelsSpy, fetchUsersSpy, isSignedIn); expect(findBoardsFilteredSearch().props('tokens')).toEqual(orderBy(tokens, ['title'])); }, diff --git a/spec/frontend/boards/components/sidebar/board_sidebar_title_spec.js b/spec/frontend/boards/components/sidebar/board_sidebar_title_spec.js index 1b526e6fbec..f354067e226 100644 --- a/spec/frontend/boards/components/sidebar/board_sidebar_title_spec.js +++ b/spec/frontend/boards/components/sidebar/board_sidebar_title_spec.js @@ -8,6 +8,7 @@ import BoardEditableItem from '~/boards/components/sidebar/board_editable_item.v import BoardSidebarTitle from '~/boards/components/sidebar/board_sidebar_title.vue'; import { createStore } from '~/boards/stores'; import issueSetTitleMutation from '~/boards/graphql/issue_set_title.mutation.graphql'; +import * as cacheUpdates from '~/boards/graphql/cache_updates'; import updateEpicTitleMutation from '~/sidebar/queries/update_epic_title.mutation.graphql'; import { updateIssueTitleResponse, updateEpicTitleResponse } from '../../mock_data'; @@ -40,6 +41,10 @@ describe('BoardSidebarTitle', () => { .fn() .mockResolvedValue(updateEpicTitleResponse); + beforeEach(() => { + cacheUpdates.setError = jest.fn(); + }); + afterEach(() => { localStorage.clear(); store = null; @@ -207,8 +212,7 @@ describe('BoardSidebarTitle', () => { it('collapses sidebar and renders former item title', () => { expect(findCollapsed().isVisible()).toBe(true); expect(findTitle().text()).toContain(TEST_ISSUE_B.title); - expect(storeDispatch).toHaveBeenCalledWith( - 'setError', + expect(cacheUpdates.setError).toHaveBeenCalledWith( expect.objectContaining({ message: 'An error occurred when updating the title' }), ); }); diff --git a/spec/frontend/boards/mock_data.js b/spec/frontend/boards/mock_data.js index 8f57a6eb7da..dfcdb4c05d0 100644 --- a/spec/frontend/boards/mock_data.js +++ b/spec/frontend/boards/mock_data.js @@ -827,7 +827,7 @@ export const mockConfidentialToken = { ], }; -export const mockTokens = (fetchLabels, fetchUsers, fetchMilestones, isSignedIn) => [ +export const mockTokens = (fetchLabels, fetchUsers, isSignedIn) => [ { icon: 'user', title: TOKEN_TITLE_ASSIGNEE, @@ -870,7 +870,8 @@ export const mockTokens = (fetchLabels, fetchUsers, fetchMilestones, isSignedIn) shouldSkipSort: true, token: MilestoneToken, unique: true, - fetchMilestones, + fullPath: 'gitlab-org', + isProject: false, }, { icon: 'issues', |