summaryrefslogtreecommitdiff
path: root/spec/frontend/batch_comments
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2021-01-20 13:34:23 -0600
committerRobert Speicher <rspeicher@gmail.com>2021-01-20 13:34:23 -0600
commit6438df3a1e0fb944485cebf07976160184697d72 (patch)
tree00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /spec/frontend/batch_comments
parent42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff)
downloadgitlab-ce-6438df3a1e0fb944485cebf07976160184697d72.tar.gz
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'spec/frontend/batch_comments')
-rw-r--r--spec/frontend/batch_comments/components/diff_file_drafts_spec.js16
-rw-r--r--spec/frontend/batch_comments/components/draft_note_spec.js6
-rw-r--r--spec/frontend/batch_comments/components/drafts_count_spec.js2
-rw-r--r--spec/frontend/batch_comments/components/preview_item_spec.js2
-rw-r--r--spec/frontend/batch_comments/components/publish_button_spec.js2
-rw-r--r--spec/frontend/batch_comments/stores/modules/batch_comments/actions_spec.js26
6 files changed, 22 insertions, 32 deletions
diff --git a/spec/frontend/batch_comments/components/diff_file_drafts_spec.js b/spec/frontend/batch_comments/components/diff_file_drafts_spec.js
index 6e0b61db9fa..dcb68b1804f 100644
--- a/spec/frontend/batch_comments/components/diff_file_drafts_spec.js
+++ b/spec/frontend/batch_comments/components/diff_file_drafts_spec.js
@@ -44,18 +44,8 @@ describe('Batch comments diff file drafts component', () => {
expect(vm.findAll('.js-diff-notes-index').length).toEqual(2);
- expect(
- vm
- .findAll('.js-diff-notes-index')
- .at(0)
- .text(),
- ).toEqual('1');
-
- expect(
- vm
- .findAll('.js-diff-notes-index')
- .at(1)
- .text(),
- ).toEqual('2');
+ expect(vm.findAll('.js-diff-notes-index').at(0).text()).toEqual('1');
+
+ expect(vm.findAll('.js-diff-notes-index').at(1).text()).toEqual('2');
});
});
diff --git a/spec/frontend/batch_comments/components/draft_note_spec.js b/spec/frontend/batch_comments/components/draft_note_spec.js
index 99980c98f8b..ae7134b63c8 100644
--- a/spec/frontend/batch_comments/components/draft_note_spec.js
+++ b/spec/frontend/batch_comments/components/draft_note_spec.js
@@ -65,7 +65,7 @@ describe('Batch comments draft note component', () => {
);
});
- it('sets as loading when draft is publishing', done => {
+ it('sets as loading when draft is publishing', (done) => {
createComponent();
wrapper.vm.$store.state.batchComments.currentlyPublishingDrafts.push(1);
@@ -80,7 +80,7 @@ describe('Batch comments draft note component', () => {
});
describe('update', () => {
- it('dispatches updateDraft', done => {
+ it('dispatches updateDraft', (done) => {
createComponent();
const note = wrapper.find(NoteableNote);
@@ -121,7 +121,7 @@ describe('Batch comments draft note component', () => {
});
describe('quick actions', () => {
- it('renders referenced commands', done => {
+ it('renders referenced commands', (done) => {
createComponent();
wrapper.setProps({
draft: {
diff --git a/spec/frontend/batch_comments/components/drafts_count_spec.js b/spec/frontend/batch_comments/components/drafts_count_spec.js
index 83d2f9eb639..5f74de9c014 100644
--- a/spec/frontend/batch_comments/components/drafts_count_spec.js
+++ b/spec/frontend/batch_comments/components/drafts_count_spec.js
@@ -27,7 +27,7 @@ describe('Batch comments drafts count component', () => {
expect(vm.$el.textContent).toContain('1');
});
- it('renders screen reader text', done => {
+ it('renders screen reader text', (done) => {
const el = vm.$el.querySelector('.sr-only');
expect(el.textContent).toContain('draft');
diff --git a/spec/frontend/batch_comments/components/preview_item_spec.js b/spec/frontend/batch_comments/components/preview_item_spec.js
index 8ddad3dacfe..173b2710a30 100644
--- a/spec/frontend/batch_comments/components/preview_item_spec.js
+++ b/spec/frontend/batch_comments/components/preview_item_spec.js
@@ -85,7 +85,7 @@ describe('Batch comments draft preview item component', () => {
describe('for thread', () => {
beforeEach(() => {
- createComponent(false, { discussion_id: '1', resolve_discussion: true }, store => {
+ createComponent(false, { discussion_id: '1', resolve_discussion: true }, (store) => {
store.state.notes.discussions.push({
id: '1',
notes: [
diff --git a/spec/frontend/batch_comments/components/publish_button_spec.js b/spec/frontend/batch_comments/components/publish_button_spec.js
index 4032713150c..eca424814b4 100644
--- a/spec/frontend/batch_comments/components/publish_button_spec.js
+++ b/spec/frontend/batch_comments/components/publish_button_spec.js
@@ -29,7 +29,7 @@ describe('Batch comments publish button component', () => {
expect(vm.$store.dispatch).toHaveBeenCalledWith('batchComments/publishReview', undefined);
});
- it('sets loading when isPublishing is true', done => {
+ it('sets loading when isPublishing is true', (done) => {
vm.$store.state.batchComments.isPublishing = true;
vm.$nextTick(() => {
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 e66f36aa3a2..3ad131de24e 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
@@ -1,6 +1,6 @@
import MockAdapter from 'axios-mock-adapter';
import testAction from 'helpers/vuex_action_helper';
-import { TEST_HOST } from 'jest/helpers/test_constants';
+import { TEST_HOST } from 'helpers/test_constants';
import * as actions from '~/batch_comments/stores/modules/batch_comments/actions';
import axios from '~/lib/utils/axios_utils';
@@ -28,7 +28,7 @@ describe('Batch comments store actions', () => {
});
describe('addDraftToDiscussion', () => {
- it('commits ADD_NEW_DRAFT if no errors returned', done => {
+ it('commits ADD_NEW_DRAFT if no errors returned', (done) => {
res = { id: 1 };
mock.onAny().reply(200, res);
@@ -42,7 +42,7 @@ describe('Batch comments store actions', () => {
);
});
- it('does not commit ADD_NEW_DRAFT if errors returned', done => {
+ it('does not commit ADD_NEW_DRAFT if errors returned', (done) => {
mock.onAny().reply(500);
testAction(
@@ -57,7 +57,7 @@ describe('Batch comments store actions', () => {
});
describe('createNewDraft', () => {
- it('commits ADD_NEW_DRAFT if no errors returned', done => {
+ it('commits ADD_NEW_DRAFT if no errors returned', (done) => {
res = { id: 1 };
mock.onAny().reply(200, res);
@@ -71,7 +71,7 @@ describe('Batch comments store actions', () => {
);
});
- it('does not commit ADD_NEW_DRAFT if errors returned', done => {
+ it('does not commit ADD_NEW_DRAFT if errors returned', (done) => {
mock.onAny().reply(500);
testAction(actions.createNewDraft, { endpoint: TEST_HOST, data: 'test' }, null, [], [], done);
@@ -89,7 +89,7 @@ describe('Batch comments store actions', () => {
};
});
- it('commits DELETE_DRAFT if no errors returned', done => {
+ it('commits DELETE_DRAFT if no errors returned', (done) => {
const commit = jest.fn();
const context = {
getters,
@@ -107,7 +107,7 @@ describe('Batch comments store actions', () => {
.catch(done.fail);
});
- it('does not commit DELETE_DRAFT if errors returned', done => {
+ it('does not commit DELETE_DRAFT if errors returned', (done) => {
const commit = jest.fn();
const context = {
getters,
@@ -136,7 +136,7 @@ describe('Batch comments store actions', () => {
};
});
- it('commits SET_BATCH_COMMENTS_DRAFTS with returned data', done => {
+ it('commits SET_BATCH_COMMENTS_DRAFTS with returned data', (done) => {
const commit = jest.fn();
const context = {
getters,
@@ -170,7 +170,7 @@ describe('Batch comments store actions', () => {
rootGetters = { discussionsStructuredByLineCode: 'discussions' };
});
- it('dispatches actions & commits', done => {
+ it('dispatches actions & commits', (done) => {
mock.onAny().reply(200);
actions
@@ -185,7 +185,7 @@ describe('Batch comments store actions', () => {
.catch(done.fail);
});
- it('dispatches error commits', done => {
+ it('dispatches error commits', (done) => {
mock.onAny().reply(500);
actions
@@ -210,7 +210,7 @@ describe('Batch comments store actions', () => {
};
});
- it('commits RECEIVE_DRAFT_UPDATE_SUCCESS with returned data', done => {
+ it('commits RECEIVE_DRAFT_UPDATE_SUCCESS with returned data', (done) => {
const commit = jest.fn();
const context = {
getters,
@@ -228,7 +228,7 @@ describe('Batch comments store actions', () => {
.catch(done.fail);
});
- it('calls passed callback', done => {
+ it('calls passed callback', (done) => {
const commit = jest.fn();
const context = {
getters,
@@ -249,7 +249,7 @@ describe('Batch comments store actions', () => {
});
describe('expandAllDiscussions', () => {
- it('dispatches expandDiscussion for all drafts', done => {
+ it('dispatches expandDiscussion for all drafts', (done) => {
const state = {
drafts: [
{