diff options
author | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-03-06 14:39:53 +0800 |
---|---|---|
committer | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-03-06 17:19:27 +0800 |
commit | d72a61b41d1aaf6b0ed9041b32fa411e8907d4f8 (patch) | |
tree | 670f9846a5283e69d90317bef39120d580c3a92e /spec | |
parent | ab391b779ecf95b3a333dac0c247354c0ef92605 (diff) | |
download | gitlab-ce-d72a61b41d1aaf6b0ed9041b32fa411e8907d4f8.tar.gz |
Handle transformed notes from polling response
Transforms notes when the note was transformed in some other tab
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/notes/stores/mutation_spec.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/javascripts/notes/stores/mutation_spec.js b/spec/javascripts/notes/stores/mutation_spec.js index aa08bf59a7f..4a640d589fb 100644 --- a/spec/javascripts/notes/stores/mutation_spec.js +++ b/spec/javascripts/notes/stores/mutation_spec.js @@ -1,5 +1,6 @@ import Vue from 'vue'; import mutations from '~/notes/stores/mutations'; +import { DISCUSSION_NOTE } from '~/notes/constants'; import { note, discussionMock, @@ -326,6 +327,18 @@ describe('Notes Store mutations', () => { expect(state.discussions[0].notes[0].note).toEqual('Foo'); }); + + it('transforms an individual note to discussion', () => { + const state = { + discussions: [individualNote], + }; + + const transformedNote = { ...individualNote.notes[0], type: DISCUSSION_NOTE }; + + mutations.UPDATE_NOTE(state, transformedNote); + + expect(state.discussions[0].individual_note).toEqual(false); + }); }); describe('CLOSE_ISSUE', () => { |