diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-18 15:11:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-18 15:11:19 +0300 |
commit | fba018726310be5fdf4014f18debbbabde19a8cd (patch) | |
tree | b335c53c751983139d07f0e7b1fa757a19e1c5db /spec/frontend/boards/stores/actions_spec.js | |
parent | 3b4c0d27d5ad32fecdcc95e86bf919fc13830c5b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/boards/stores/actions_spec.js')
-rw-r--r-- | spec/frontend/boards/stores/actions_spec.js | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/spec/frontend/boards/stores/actions_spec.js b/spec/frontend/boards/stores/actions_spec.js index 9d3ba5b105e..1272a573d2f 100644 --- a/spec/frontend/boards/stores/actions_spec.js +++ b/spec/frontend/boards/stores/actions_spec.js @@ -9,6 +9,7 @@ import { issuableTypes, BoardType, listsQuery, + DraggableItemTypes, } from 'ee_else_ce/boards/constants'; import issueMoveListMutation from 'ee_else_ce/boards/graphql/issue_move_list.mutation.graphql'; import testAction from 'helpers/vuex_action_helper'; @@ -525,6 +526,21 @@ describe('moveList', () => { const movableListsOrder = ['gid://3', 'gid://4', 'gid://5']; const allListsOrder = [backlogListId, ...movableListsOrder, closedListId]; + it(`should not handle the event if the dragged item is not a "${DraggableItemTypes.list}"`, () => { + return testAction({ + action: actions.moveList, + payload: { + item: { dataset: { listId: '', draggableItemType: DraggableItemTypes.card } }, + to: { + children: [], + }, + }, + state: {}, + expectedMutations: [], + expectedActions: [], + }); + }); + describe.each` draggableFrom | draggableTo | boardLists | boardListsOrder | expectedMovableListsOrder ${0} | ${2} | ${boardLists1} | ${movableListsOrder} | ${['gid://4', 'gid://5', 'gid://3']} @@ -544,7 +560,12 @@ describe('moveList', () => { const displacedListId = boardListsOrder[draggableTo]; const buildDraggablePayload = () => { return { - item: { dataset: { listId: boardListsOrder[draggableFrom] } }, + item: { + dataset: { + listId: boardListsOrder[draggableFrom], + draggableItemType: DraggableItemTypes.list, + }, + }, newIndex: draggableTo, to: { children: boardListsOrder.map((listId) => ({ dataset: { listId } })), @@ -584,7 +605,7 @@ describe('moveList', () => { return testAction({ action: actions.moveList, payload: { - item: { dataset: { listId } }, + item: { dataset: { listId, draggbaleItemType: DraggableItemTypes.list } }, newIndex: 0, to: { children: [{ dataset: { listId } }], |