import { GlDrawer } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import Vuex from 'vuex'; import { stubComponent } from 'helpers/stub_component'; import BoardContentSidebar from '~/boards/components/board_content_sidebar.vue'; import BoardSidebarDueDate from '~/boards/components/sidebar/board_sidebar_due_date.vue'; import BoardSidebarLabelsSelect from '~/boards/components/sidebar/board_sidebar_labels_select.vue'; import BoardSidebarMilestoneSelect from '~/boards/components/sidebar/board_sidebar_milestone_select.vue'; import BoardSidebarTitle from '~/boards/components/sidebar/board_sidebar_title.vue'; import { ISSUABLE } from '~/boards/constants'; import SidebarSubscriptionsWidget from '~/sidebar/components/subscriptions/sidebar_subscriptions_widget.vue'; import { mockIssue, mockIssueGroupPath, mockIssueProjectPath } from '../mock_data'; describe('BoardContentSidebar', () => { let wrapper; let store; const createStore = ({ mockGetters = {}, mockActions = {} } = {}) => { store = new Vuex.Store({ state: { sidebarType: ISSUABLE, issues: { [mockIssue.id]: { ...mockIssue, epic: null } }, activeId: mockIssue.id, issuableType: 'issue', }, getters: { activeBoardItem: () => { return { ...mockIssue, epic: null }; }, groupPathForActiveIssue: () => mockIssueGroupPath, projectPathForActiveIssue: () => mockIssueProjectPath, isSidebarOpen: () => true, ...mockGetters, }, actions: mockActions, }); }; const createComponent = () => { /* Dynamically imported components (in our case ee imports) aren't stubbed automatically in VTU v1: https://github.com/vuejs/vue-test-utils/issues/1279. This requires us to additionally mock apollo or vuex stores. */ wrapper = shallowMount(BoardContentSidebar, { provide: { canUpdate: true, rootPath: '/', groupId: 1, }, store, stubs: { GlDrawer: stubComponent(GlDrawer, { template: '