From 38ff3a81189c8323d323946afcf7dad62c84b9aa Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 9 Feb 2023 03:07:46 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .../boards/components/board_list_header_spec.js | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'spec/frontend/boards/components') diff --git a/spec/frontend/boards/components/board_list_header_spec.js b/spec/frontend/boards/components/board_list_header_spec.js index a16b99728c3..80e77921459 100644 --- a/spec/frontend/boards/components/board_list_header_spec.js +++ b/spec/frontend/boards/components/board_list_header_spec.js @@ -35,6 +35,7 @@ describe('Board List Header Component', () => { withLocalStorage = true, currentUserId = 1, listQueryHandler = jest.fn().mockResolvedValue(boardListQueryResponse()), + injectedProps = {}, } = {}) => { const boardId = '1'; @@ -76,6 +77,7 @@ describe('Board List Header Component', () => { currentUserId, isEpicBoard: false, disabled: false, + ...injectedProps, }, }), ); @@ -86,6 +88,7 @@ describe('Board List Header Component', () => { const findAddIssueButton = () => wrapper.findComponent({ ref: 'newIssueBtn' }); const findTitle = () => wrapper.find('.board-title'); const findCaret = () => wrapper.findByTestId('board-title-caret'); + const findSettingsButton = () => wrapper.findComponent({ ref: 'settingsBtn' }); describe('Add issue button', () => { const hasNoAddButton = [ListType.closed]; @@ -126,6 +129,33 @@ describe('Board List Header Component', () => { }); }); + describe('Settings Button', () => { + describe('with disabled=true', () => { + const hasSettings = [ + ListType.assignee, + ListType.milestone, + ListType.iteration, + ListType.label, + ]; + const hasNoSettings = [ListType.backlog, ListType.closed]; + + it.each(hasSettings)('does render for List Type `%s` when disabled=true', (listType) => { + createComponent({ listType, injectedProps: { disabled: true } }); + + expect(findSettingsButton().exists()).toBe(true); + }); + + it.each(hasNoSettings)( + 'does not render for List Type `%s` when disabled=true', + (listType) => { + createComponent({ listType }); + + expect(findSettingsButton().exists()).toBe(false); + }, + ); + }); + }); + describe('expanding / collapsing the column', () => { it('should display collapse icon when column is expanded', async () => { createComponent(); -- cgit v1.2.3