diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-03 18:08:43 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-03 18:08:43 +0300 |
commit | dbe0e5676267eb142dd8d81e4c881c997cb96962 (patch) | |
tree | 765b50588c3c1540297dc6a76eea1122dd59cdac /spec/frontend/batch_comments | |
parent | 14a32c2d551a646525b1fabd93cb70a0e6924478 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/batch_comments')
-rw-r--r-- | spec/frontend/batch_comments/stores/modules/batch_comments/actions_spec.js | 6 | ||||
-rw-r--r-- | spec/frontend/batch_comments/stores/modules/batch_comments/mutations_spec.js | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/spec/frontend/batch_comments/stores/modules/batch_comments/actions_spec.js b/spec/frontend/batch_comments/stores/modules/batch_comments/actions_spec.js index 20eedcbb25b..57bafb51cd6 100644 --- a/spec/frontend/batch_comments/stores/modules/batch_comments/actions_spec.js +++ b/spec/frontend/batch_comments/stores/modules/batch_comments/actions_spec.js @@ -317,4 +317,10 @@ describe('Batch comments store actions', () => { expect(window.mrTabs.tabShown).toHaveBeenCalledWith('diffs'); }); }); + + describe('clearDrafts', () => { + it('commits CLEAR_DRAFTS', () => { + return testAction(actions.clearDrafts, null, null, [{ type: 'CLEAR_DRAFTS' }], []); + }); + }); }); diff --git a/spec/frontend/batch_comments/stores/modules/batch_comments/mutations_spec.js b/spec/frontend/batch_comments/stores/modules/batch_comments/mutations_spec.js index fe01de638c2..ad6a1a38164 100644 --- a/spec/frontend/batch_comments/stores/modules/batch_comments/mutations_spec.js +++ b/spec/frontend/batch_comments/stores/modules/batch_comments/mutations_spec.js @@ -104,4 +104,14 @@ describe('Batch comments mutations', () => { ]); }); }); + + describe(types.CLEAR_DRAFTS, () => { + it('clears drafts array', () => { + state.drafts.push({ id: 1 }); + + mutations[types.CLEAR_DRAFTS](state); + + expect(state.drafts).toEqual([]); + }); + }); }); |