summaryrefslogtreecommitdiff
path: root/spec/frontend/batch_comments
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-06-16 18:25:58 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-16 18:25:58 +0000
commita5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch)
treefb69158581673816a8cd895f9d352dcb3c678b1e /spec/frontend/batch_comments
parentd16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff)
downloadgitlab-ce-a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4.tar.gz
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'spec/frontend/batch_comments')
-rw-r--r--spec/frontend/batch_comments/components/preview_item_spec.js4
-rw-r--r--spec/frontend/batch_comments/stores/modules/batch_comments/actions_spec.js6
2 files changed, 8 insertions, 2 deletions
diff --git a/spec/frontend/batch_comments/components/preview_item_spec.js b/spec/frontend/batch_comments/components/preview_item_spec.js
index 03a28ce8001..cb71edd1238 100644
--- a/spec/frontend/batch_comments/components/preview_item_spec.js
+++ b/spec/frontend/batch_comments/components/preview_item_spec.js
@@ -104,7 +104,7 @@ describe('Batch comments draft preview item component', () => {
notes: [
{
author: {
- name: 'Author Name',
+ name: "Author 'Nick' Name",
},
},
],
@@ -114,7 +114,7 @@ describe('Batch comments draft preview item component', () => {
it('renders title', () => {
expect(vm.$el.querySelector('.review-preview-item-header-text').textContent).toContain(
- "Author Name's thread",
+ "Author 'Nick' Name's thread",
);
});
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 da19265ce82..b0e9e5dd00b 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
@@ -139,9 +139,14 @@ describe('Batch comments store actions', () => {
it('commits SET_BATCH_COMMENTS_DRAFTS with returned data', (done) => {
const commit = jest.fn();
+ const dispatch = jest.fn();
const context = {
getters,
commit,
+ dispatch,
+ state: {
+ drafts: [{ line_code: '123' }, { line_code: null, discussion_id: '1' }],
+ },
};
res = { id: 1 };
mock.onAny().reply(200, res);
@@ -150,6 +155,7 @@ describe('Batch comments store actions', () => {
.fetchDrafts(context)
.then(() => {
expect(commit).toHaveBeenCalledWith('SET_BATCH_COMMENTS_DRAFTS', { id: 1 });
+ expect(dispatch).toHaveBeenCalledWith('convertToDiscussion', '1', { root: true });
})
.then(done)
.catch(done.fail);