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-04-20 12:09:48 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-04-20 12:09:48 +0300
commit03409cccee9b1cd8104484077338790add355c7d (patch)
tree82b4fbbb96d82f235dd1f76f155cd01a1a52d22a /spec/frontend/notes
parent93f77228e32908b64ce7b9a3eb69e48efff11a9c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/notes')
-rw-r--r--spec/frontend/notes/components/notes_app_spec.js14
-rw-r--r--spec/frontend/notes/mock_data.js14
2 files changed, 16 insertions, 12 deletions
diff --git a/spec/frontend/notes/components/notes_app_spec.js b/spec/frontend/notes/components/notes_app_spec.js
index 727e24b6bd9..241a89b2218 100644
--- a/spec/frontend/notes/components/notes_app_spec.js
+++ b/spec/frontend/notes/components/notes_app_spec.js
@@ -408,10 +408,9 @@ describe('note_app', () => {
store = createStore();
store.registerModule('batchComments', batchComments());
store.state.batchComments.drafts = [
- { line_code: 1, isDraft: true },
- { discussion_id: 1, isDraft: true },
- { note: 'A', isDraft: true },
- { note: 'B', isDraft: true },
+ mockData.draftDiffDiscussion,
+ mockData.draftReply,
+ ...mockData.draftComments,
];
store.state.isLoading = false;
wrapper = shallowMount(NotesApp, {
@@ -426,10 +425,9 @@ describe('note_app', () => {
it('correctly finds only draft comments', () => {
const drafts = wrapper.findAll(DraftNote).wrappers;
- expect(drafts.map((x) => x.props('draft'))).toEqual([
- expect.objectContaining({ note: 'A' }),
- expect.objectContaining({ note: 'B' }),
- ]);
+ expect(drafts.map((x) => x.props('draft'))).toEqual(
+ mockData.draftComments.map(({ note }) => expect.objectContaining({ note })),
+ );
});
});
});
diff --git a/spec/frontend/notes/mock_data.js b/spec/frontend/notes/mock_data.js
index 44bb87d7736..a4aeeda48d8 100644
--- a/spec/frontend/notes/mock_data.js
+++ b/spec/frontend/notes/mock_data.js
@@ -1273,10 +1273,16 @@ export const batchSuggestionsInfoMock = [
];
export const draftComments = [
- { id: 7, note: 'test draft note' },
- { id: 9, note: 'draft note 2' },
+ { id: 7, note: 'test draft note', isDraft: true },
+ { id: 9, note: 'draft note 2', isDraft: true },
];
-export const draftReply = { id: 8, note: 'draft reply', discussion_id: 1 };
+export const draftReply = { id: 8, note: 'draft reply', discussion_id: 1, isDraft: true };
-export const draftDiffDiscussion = { id: 6, note: 'draft diff discussion', line_code: 1 };
+export const draftDiffDiscussion = {
+ id: 6,
+ note: 'draft diff discussion',
+ line_code: 1,
+ file_path: 'lib/foo.rb',
+ isDraft: true,
+};