diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
commit | 9297025d0b7ddf095eb618dfaaab2ff8f2018d8b (patch) | |
tree | 865198c01d1824a9b098127baa3ab980c9cd2c06 /spec/frontend/boards/components/board_card_move_to_position_spec.js | |
parent | 6372471f43ee03c05a7c1f8b0c6ac6b8a7431dbe (diff) |
Add latest changes from gitlab-org/gitlab@16-7-stable-eev16.7.0-rc42
Diffstat (limited to 'spec/frontend/boards/components/board_card_move_to_position_spec.js')
-rw-r--r-- | spec/frontend/boards/components/board_card_move_to_position_spec.js | 69 |
1 files changed, 1 insertions, 68 deletions
diff --git a/spec/frontend/boards/components/board_card_move_to_position_spec.js b/spec/frontend/boards/components/board_card_move_to_position_spec.js index 20beaf2e9bd..d3c43a4e054 100644 --- a/spec/frontend/boards/components/board_card_move_to_position_spec.js +++ b/spec/frontend/boards/components/board_card_move_to_position_spec.js @@ -8,7 +8,7 @@ import { BOARD_CARD_MOVE_TO_POSITIONS_END_OPTION, } from '~/boards/constants'; import BoardCardMoveToPosition from '~/boards/components/board_card_move_to_position.vue'; -import { mockList, mockIssue2, mockIssue, mockIssue3, mockIssue4 } from 'jest/boards/mock_data'; +import { mockList, mockIssue2 } from 'jest/boards/mock_data'; import { mockTracking, unmockTracking } from 'helpers/tracking_helper'; Vue.use(Vuex); @@ -28,30 +28,8 @@ describe('Board Card Move to position', () => { let wrapper; let trackingSpy; let store; - let dispatch; const itemIndex = 1; - const createStoreOptions = () => { - const state = { - pageInfoByListId: { - 'gid://gitlab/List/1': {}, - 'gid://gitlab/List/2': { hasNextPage: true }, - }, - }; - const getters = { - getBoardItemsByList: () => () => [mockIssue, mockIssue2, mockIssue3, mockIssue4], - }; - const actions = { - moveItem: jest.fn(), - }; - - return { - state, - getters, - actions, - }; - }; - const createComponent = (propsData, isApolloBoard = false) => { wrapper = shallowMount(BoardCardMoveToPosition, { store, @@ -73,7 +51,6 @@ describe('Board Card Move to position', () => { }; beforeEach(() => { - store = new Vuex.Store(createStoreOptions()); createComponent(); }); @@ -97,50 +74,6 @@ describe('Board Card Move to position', () => { describe('Dropdown options', () => { beforeEach(() => { - createComponent({ index: itemIndex }); - trackingSpy = mockTracking(undefined, wrapper.element, jest.spyOn); - dispatch = jest.spyOn(store, 'dispatch').mockImplementation(() => {}); - }); - - afterEach(() => { - unmockTracking(); - }); - - it.each` - dropdownIndex | dropdownItem | trackLabel | positionInList - ${0} | ${dropdownOptions[0]} | ${'move_to_start'} | ${0} - ${1} | ${dropdownOptions[1]} | ${'move_to_end'} | ${-1} - `( - 'on click of dropdown index $dropdownIndex with label $dropdownLabel should call moveItem action with tracking label $trackLabel', - async ({ dropdownIndex, dropdownItem, trackLabel, positionInList }) => { - await findMoveToPositionDropdown().vm.$emit('shown'); - - expect(findDropdownItemAtIndex(dropdownIndex).text()).toBe(dropdownItem.text); - - await findMoveToPositionDropdown().vm.$emit('action', dropdownItem); - - expect(trackingSpy).toHaveBeenCalledWith('boards:list', 'click_toggle_button', { - category: 'boards:list', - label: trackLabel, - property: 'type_card', - }); - - expect(dispatch).toHaveBeenCalledWith('moveItem', { - fromListId: mockList.id, - itemId: mockIssue2.id, - itemIid: mockIssue2.iid, - itemPath: mockIssue2.referencePath, - positionInList, - toListId: mockList.id, - allItemsLoadedInList: true, - atIndex: itemIndex, - }); - }, - ); - }); - - describe('Apollo boards', () => { - beforeEach(() => { createComponent({ index: itemIndex }, true); trackingSpy = mockTracking(undefined, wrapper.element, jest.spyOn); }); |