diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-05 15:09:31 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-05 15:09:31 +0300 |
commit | 64f7eb2b37aebbb713463b2f6971b13191c1b0db (patch) | |
tree | 186ce376859dc04055a20d87945556eec63acd68 /spec/frontend/notes | |
parent | 315243f87739dd1edda2b75361f826abc91d4069 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/notes')
-rw-r--r-- | spec/frontend/notes/stores/actions_spec.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/frontend/notes/stores/actions_spec.js b/spec/frontend/notes/stores/actions_spec.js index 468e5af6f1a..e2a7a16dbf2 100644 --- a/spec/frontend/notes/stores/actions_spec.js +++ b/spec/frontend/notes/stores/actions_spec.js @@ -1312,6 +1312,7 @@ describe('Actions Notes Store', () => { return actions .updateConfidentialityOnIssuable({ commit: commitSpy, state, getters }, actionArgs) .then(() => { + expect(Flash).not.toHaveBeenCalled(); expect(commitSpy).toHaveBeenCalledWith( mutationTypes.SET_ISSUE_CONFIDENTIAL, confidential, @@ -1319,6 +1320,22 @@ describe('Actions Notes Store', () => { }); }); }); + + 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` |