diff options
Diffstat (limited to 'spec/frontend/boards/stores/actions_spec.js')
-rw-r--r-- | spec/frontend/boards/stores/actions_spec.js | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/spec/frontend/boards/stores/actions_spec.js b/spec/frontend/boards/stores/actions_spec.js index ab959abaa99..b8d3be28ca6 100644 --- a/spec/frontend/boards/stores/actions_spec.js +++ b/spec/frontend/boards/stores/actions_spec.js @@ -2,13 +2,7 @@ import * as Sentry from '@sentry/browser'; import { cloneDeep } from 'lodash'; import Vue from 'vue'; import Vuex from 'vuex'; -import { - inactiveId, - ISSUABLE, - ListType, - BoardType, - DraggableItemTypes, -} from 'ee_else_ce/boards/constants'; +import { inactiveId, ISSUABLE, ListType, 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'; import { @@ -26,7 +20,7 @@ import actions from '~/boards/stores/actions'; import * as types from '~/boards/stores/mutation_types'; import mutations from '~/boards/stores/mutations'; import { getIdFromGraphQLId } from '~/graphql_shared/utils'; -import { TYPE_ISSUE } from '~/issues/constants'; +import { TYPE_ISSUE, WORKSPACE_GROUP, WORKSPACE_PROJECT } from '~/issues/constants'; import projectBoardMilestones from '~/boards/graphql/project_board_milestones.query.graphql'; import groupBoardMilestones from '~/boards/graphql/group_board_milestones.query.graphql'; @@ -49,7 +43,7 @@ import { mockMilestones, } from '../mock_data'; -jest.mock('~/flash'); +jest.mock('~/alert'); // We need this helper to make sure projectPath is including // subgroups when the movIssue action is called. @@ -300,8 +294,8 @@ describe('fetchLists', () => { it.each` issuableType | boardType | fullBoardId | isGroup | isProject - ${TYPE_ISSUE} | ${BoardType.group} | ${'gid://gitlab/Board/1'} | ${true} | ${false} - ${TYPE_ISSUE} | ${BoardType.project} | ${'gid://gitlab/Board/1'} | ${false} | ${true} + ${TYPE_ISSUE} | ${WORKSPACE_GROUP} | ${'gid://gitlab/Board/1'} | ${true} | ${false} + ${TYPE_ISSUE} | ${WORKSPACE_PROJECT} | ${'gid://gitlab/Board/1'} | ${false} | ${true} `( 'calls $issuableType query with correct variables', async ({ issuableType, boardType, fullBoardId, isGroup, isProject }) => { @@ -336,7 +330,7 @@ describe('fetchLists', () => { describe('fetchMilestones', () => { const queryResponse = { data: { - project: { + workspace: { milestones: { nodes: mockMilestones, }, @@ -346,7 +340,7 @@ describe('fetchMilestones', () => { const queryErrors = { data: { - project: { + workspace: { errors: ['You cannot view these milestones'], milestones: {}, }, @@ -407,7 +401,7 @@ describe('fetchMilestones', () => { }, ); - it('sets milestonesLoading to true', async () => { + it('sets milestonesLoading to true', () => { jest.spyOn(gqlClient, 'query').mockResolvedValue(queryResponse); const store = createStore(); |