Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-17 12:09:36 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-17 12:09:36 +0300
commit839e879bcf197a283da8481ddcb15b177172784d (patch)
treebf2b1e0b27c98340d194469a4b3a5e02d4a2acb8 /spec/frontend/boards/stores/actions_spec.js
parent3c97422b098235bca250f738922dab9c861f0ee7 (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.js42
1 files changed, 1 insertions, 41 deletions
diff --git a/spec/frontend/boards/stores/actions_spec.js b/spec/frontend/boards/stores/actions_spec.js
index 1649bab3baf..32d0e7ae886 100644
--- a/spec/frontend/boards/stores/actions_spec.js
+++ b/spec/frontend/boards/stores/actions_spec.js
@@ -11,8 +11,6 @@ import issueCreateMutation from '~/boards/graphql/issue_create.mutation.graphql'
import issueMoveListMutation from '~/boards/graphql/issue_move_list.mutation.graphql';
import actions, { gqlClient } from '~/boards/stores/actions';
import * as types from '~/boards/stores/mutation_types';
-import createFlash from '~/flash';
-import updateAssignees from '~/vue_shared/components/sidebar/queries/updateAssignees.mutation.graphql';
import {
mockLists,
mockListsById,
@@ -726,65 +724,27 @@ describe('moveIssue', () => {
describe('setAssignees', () => {
const node = { username: 'name' };
- const name = 'username';
const projectPath = 'h/h';
const refPath = `${projectPath}#3`;
const iid = '1';
describe('when succeeds', () => {
- beforeEach(() => {
- jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
- data: { issueSetAssignees: { issue: { assignees: { nodes: [{ ...node }] } } } },
- });
- });
-
- it('calls mutate with the correct values', async () => {
- await actions.setAssignees(
- { commit: () => {}, getters: { activeIssue: { iid, referencePath: refPath } } },
- [name],
- );
-
- expect(gqlClient.mutate).toHaveBeenCalledWith({
- mutation: updateAssignees,
- variables: { iid, assigneeUsernames: [name], projectPath },
- });
- });
-
it('calls the correct mutation with the correct values', (done) => {
testAction(
actions.setAssignees,
- {},
+ [node],
{ activeIssue: { iid, referencePath: refPath }, commit: () => {} },
[
- { type: types.SET_ASSIGNEE_LOADING, payload: true },
{
type: 'UPDATE_ISSUE_BY_ID',
payload: { prop: 'assignees', issueId: undefined, value: [node] },
},
- { type: types.SET_ASSIGNEE_LOADING, payload: false },
],
[],
done,
);
});
});
-
- describe('when fails', () => {
- beforeEach(() => {
- jest.spyOn(gqlClient, 'mutate').mockRejectedValue();
- });
-
- it('calls createFlash', async () => {
- await actions.setAssignees({
- commit: () => {},
- getters: { activeIssue: { iid, referencePath: refPath } },
- });
-
- expect(createFlash).toHaveBeenCalledWith({
- message: 'An error occurred while updating assignees.',
- });
- });
- });
});
describe('createNewIssue', () => {