diff options
Diffstat (limited to 'spec/frontend/boards/stores/getters_spec.js')
-rw-r--r-- | spec/frontend/boards/stores/getters_spec.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/frontend/boards/stores/getters_spec.js b/spec/frontend/boards/stores/getters_spec.js index 267451845ba..288143a0f21 100644 --- a/spec/frontend/boards/stores/getters_spec.js +++ b/spec/frontend/boards/stores/getters_spec.js @@ -1,5 +1,6 @@ import getters from '~/boards/stores/getters'; import { inactiveId } from '~/boards/constants'; +import { mockIssue, mockIssue2, mockIssues, mockIssuesByListId, issues } from '../mock_data'; describe('Boards - Getters', () => { describe('getLabelToggleState', () => { @@ -115,4 +116,18 @@ describe('Boards - Getters', () => { expect(getters.getActiveIssue(state)).toEqual(expected); }); }); + + describe('getIssues', () => { + const boardsState = { + issuesByListId: mockIssuesByListId, + issues, + }; + it('returns issues for a given listId', () => { + const getIssueById = issueId => [mockIssue, mockIssue2].find(({ id }) => id === issueId); + + expect(getters.getIssues(boardsState, { getIssueById })('gid://gitlab/List/2')).toEqual( + mockIssues, + ); + }); + }); }); |