diff options
Diffstat (limited to 'spec/frontend/boards/mock_data.js')
-rw-r--r-- | spec/frontend/boards/mock_data.js | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/spec/frontend/boards/mock_data.js b/spec/frontend/boards/mock_data.js index a081a60166b..24096fddea6 100644 --- a/spec/frontend/boards/mock_data.js +++ b/spec/frontend/boards/mock_data.js @@ -29,6 +29,85 @@ export const listObj = { }, }; +function boardGenerator(n) { + return new Array(n).fill().map((board, index) => { + const id = `${index}`; + const name = `board${id}`; + + return { + node: { + id, + name, + weight: 0, + __typename: 'Board', + }, + }; + }); +} + +export const boards = boardGenerator(20); +export const recentIssueBoards = boardGenerator(5); + +export const mockSmallProjectAllBoardsResponse = { + data: { + project: { + id: 'gid://gitlab/Project/114', + boards: { edges: boardGenerator(3) }, + __typename: 'Project', + }, + }, +}; + +export const mockEmptyProjectRecentBoardsResponse = { + data: { + project: { + id: 'gid://gitlab/Project/114', + recentIssueBoards: { edges: [] }, + __typename: 'Project', + }, + }, +}; + +export const mockGroupAllBoardsResponse = { + data: { + group: { + id: 'gid://gitlab/Group/114', + boards: { edges: boards }, + __typename: 'Group', + }, + }, +}; + +export const mockProjectAllBoardsResponse = { + data: { + project: { + id: 'gid://gitlab/Project/1', + boards: { edges: boards }, + __typename: 'Project', + }, + }, +}; + +export const mockGroupRecentBoardsResponse = { + data: { + group: { + id: 'gid://gitlab/Group/114', + recentIssueBoards: { edges: recentIssueBoards }, + __typename: 'Group', + }, + }, +}; + +export const mockProjectRecentBoardsResponse = { + data: { + project: { + id: 'gid://gitlab/Project/1', + recentIssueBoards: { edges: recentIssueBoards }, + __typename: 'Project', + }, + }, +}; + export const mockGroupBoardResponse = { data: { workspace: { @@ -612,6 +691,7 @@ export const mockTokens = (fetchLabels, fetchAuthors, fetchMilestones, isSignedI title: __('Milestone'), symbol: '%', type: 'milestone', + shouldSkipSort: true, token: MilestoneToken, unique: true, fetchMilestones, |