diff options
Diffstat (limited to 'spec/frontend/boards/components/board_list_header_spec.js')
-rw-r--r-- | spec/frontend/boards/components/board_list_header_spec.js | 30 |
1 files changed, 30 insertions, 0 deletions
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(); |