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-25 15:11:01 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-25 15:11:01 +0300
commitb2452a369250083ed416b90fe233583c64413877 (patch)
treecd02c529abe78b8879ad2de2a3bff887cea94092 /spec/frontend/notes/stores
parentbcfab67c0f33aeda96041f341f92cf0ff1e062d3 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/notes/stores')
-rw-r--r--spec/frontend/notes/stores/actions_spec.js63
1 files changed, 0 insertions, 63 deletions
diff --git a/spec/frontend/notes/stores/actions_spec.js b/spec/frontend/notes/stores/actions_spec.js
index 1852108b39f..27024997530 100644
--- a/spec/frontend/notes/stores/actions_spec.js
+++ b/spec/frontend/notes/stores/actions_spec.js
@@ -10,7 +10,6 @@ import * as actions from '~/notes/stores/actions';
import * as mutationTypes from '~/notes/stores/mutation_types';
import mutations from '~/notes/stores/mutations';
import * as utils from '~/notes/stores/utils';
-import updateIssueConfidentialMutation from '~/sidebar/components/confidential/mutations/update_issue_confidential.mutation.graphql';
import updateIssueLockMutation from '~/sidebar/components/lock/mutations/update_issue_lock.mutation.graphql';
import updateMergeRequestLockMutation from '~/sidebar/components/lock/mutations/update_merge_request_lock.mutation.graphql';
import mrWidgetEventHub from '~/vue_merge_request_widget/event_hub';
@@ -1276,68 +1275,6 @@ describe('Actions Notes Store', () => {
});
});
- describe('updateConfidentialityOnIssuable', () => {
- state = { noteableData: { confidential: false } };
- const iid = '1';
- const projectPath = 'full/path';
- const getters = { getNoteableData: { iid } };
- const actionArgs = { fullPath: projectPath, confidential: true };
- const confidential = true;
-
- beforeEach(() => {
- jest
- .spyOn(utils.gqClient, 'mutate')
- .mockResolvedValue({ data: { issueSetConfidential: { issue: { confidential } } } });
- });
-
- it('calls gqClient mutation one time', () => {
- actions.updateConfidentialityOnIssuable({ commit: () => {}, state, getters }, actionArgs);
-
- expect(utils.gqClient.mutate).toHaveBeenCalledTimes(1);
- });
-
- it('calls gqClient mutation with the correct values', () => {
- actions.updateConfidentialityOnIssuable({ commit: () => {}, state, getters }, actionArgs);
-
- expect(utils.gqClient.mutate).toHaveBeenCalledWith({
- mutation: updateIssueConfidentialMutation,
- variables: { input: { iid, projectPath, confidential } },
- });
- });
-
- describe('on success of mutation', () => {
- it('calls commit with the correct values', () => {
- const commitSpy = jest.fn();
-
- return actions
- .updateConfidentialityOnIssuable({ commit: commitSpy, state, getters }, actionArgs)
- .then(() => {
- expect(Flash).not.toHaveBeenCalled();
- expect(commitSpy).toHaveBeenCalledWith(
- mutationTypes.SET_ISSUE_CONFIDENTIAL,
- confidential,
- );
- });
- });
- });
-
- describe('on user recoverable error', () => {
- it('sends the error to Flash', () => {
- const error = 'error';
-
- jest
- .spyOn(utils.gqClient, 'mutate')
- .mockResolvedValue({ data: { issueSetConfidential: { errors: [error] } } });
-
- return actions
- .updateConfidentialityOnIssuable({ commit: () => {}, state, getters }, actionArgs)
- .then(() => {
- expect(Flash).toHaveBeenCalledWith(error, 'alert');
- });
- });
- });
- });
-
describe.each`
issuableType
${'issue'} | ${'merge_request'}