diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-20 12:09:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-20 12:09:48 +0300 |
commit | 03409cccee9b1cd8104484077338790add355c7d (patch) | |
tree | 82b4fbbb96d82f235dd1f76f155cd01a1a52d22a /spec/frontend/notes | |
parent | 93f77228e32908b64ce7b9a3eb69e48efff11a9c (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.js | 14 | ||||
-rw-r--r-- | spec/frontend/notes/mock_data.js | 14 |
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, +}; |