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/board_card_inner_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/board_card_inner_spec.js')
-rw-r--r-- | spec/frontend/boards/board_card_inner_spec.js | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/spec/frontend/boards/board_card_inner_spec.js b/spec/frontend/boards/board_card_inner_spec.js index c70e461da83..8f2752b6bd8 100644 --- a/spec/frontend/boards/board_card_inner_spec.js +++ b/spec/frontend/boards/board_card_inner_spec.js @@ -2,8 +2,6 @@ import { GlLabel, GlLoadingIcon } from '@gitlab/ui'; import { range } from 'lodash'; import Vue, { nextTick } from 'vue'; import VueApollo from 'vue-apollo'; -// eslint-disable-next-line no-restricted-imports -import Vuex from 'vuex'; import createMockApollo from 'helpers/mock_apollo_helper'; import setWindowLocation from 'helpers/set_window_location_helper'; import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; @@ -13,15 +11,13 @@ import BoardCardInner from '~/boards/components/board_card_inner.vue'; import isShowingLabelsQuery from '~/graphql_shared/client/is_showing_labels.query.graphql'; import WorkItemTypeIcon from '~/work_items/components/work_item_type_icon.vue'; import eventHub from '~/boards/eventhub'; -import defaultStore from '~/boards/stores'; import { TYPE_ISSUE } from '~/issues/constants'; import { updateHistory } from '~/lib/utils/url_utility'; -import { mockLabelList, mockIssue, mockIssueFullPath } from './mock_data'; +import { mockLabelList, mockIssue, mockIssueFullPath, mockIssueDirectNamespace } from './mock_data'; jest.mock('~/lib/utils/url_utility'); jest.mock('~/boards/eventhub'); -Vue.use(Vuex); Vue.use(VueApollo); describe('Board card component', () => { @@ -43,24 +39,12 @@ describe('Board card component', () => { let wrapper; let issue; let list; - let store; const findIssuableBlockedIcon = () => wrapper.findComponent(IssuableBlockedIcon); const findLoadingIcon = () => wrapper.findComponent(GlLoadingIcon); const findHiddenIssueIcon = () => wrapper.findByTestId('hidden-icon'); const findWorkItemIcon = () => wrapper.findComponent(WorkItemTypeIcon); - const performSearchMock = jest.fn(); - - const createStore = () => { - store = new Vuex.Store({ - actions: { - performSearch: performSearchMock, - }, - state: defaultStore.state, - }); - }; - const mockApollo = createMockApollo(); const createWrapper = ({ props = {}, isGroupBoard = true } = {}) => { @@ -72,7 +56,6 @@ describe('Board card component', () => { }); wrapper = mountExtended(BoardCardInner, { - store, apolloProvider: mockApollo, propsData: { list, @@ -94,7 +77,6 @@ describe('Board card component', () => { allowSubEpics: false, issuableType: TYPE_ISSUE, isGroupBoard, - isApolloBoard: false, }, }); }; @@ -108,14 +90,9 @@ describe('Board card component', () => { weight: 1, }; - createStore(); createWrapper({ props: { item: issue, list } }); }); - afterEach(() => { - store = null; - }); - it('renders issue title', () => { expect(wrapper.find('.board-card-title').text()).toContain(issue.title); }); @@ -159,14 +136,15 @@ describe('Board card component', () => { }); it('does not render item reference path', () => { - createStore(); createWrapper({ isGroupBoard: false }); - expect(wrapper.find('.board-card-number').text()).not.toContain(mockIssueFullPath); + expect(wrapper.find('.board-card-number').text()).not.toContain(mockIssueDirectNamespace); + expect(wrapper.find('.board-item-path').exists()).toBe(false); }); - it('renders item reference path', () => { - expect(wrapper.find('.board-card-number').text()).toContain(mockIssueFullPath); + it('renders item direct namespace path with full reference path in a tooltip', () => { + expect(wrapper.find('.board-item-path').text()).toBe(mockIssueDirectNamespace); + expect(wrapper.find('.board-item-path').attributes('title')).toBe(mockIssueFullPath); }); describe('blocked', () => { @@ -458,10 +436,6 @@ describe('Board card component', () => { expect(updateHistory).toHaveBeenCalledTimes(1); }); - it('dispatches performSearch vuex action', () => { - expect(performSearchMock).toHaveBeenCalledTimes(1); - }); - it('emits updateTokens event', () => { expect(eventHub.$emit).toHaveBeenCalledTimes(1); expect(eventHub.$emit).toHaveBeenCalledWith('updateTokens'); @@ -478,10 +452,6 @@ describe('Board card component', () => { expect(updateHistory).not.toHaveBeenCalled(); }); - it('does not dispatch performSearch vuex action', () => { - expect(performSearchMock).not.toHaveBeenCalled(); - }); - it('does not emit updateTokens event', () => { expect(eventHub.$emit).not.toHaveBeenCalled(); }); |