diff options
author | Andreas Kämmerle <andreas.kaemmerle@gmail.com> | 2018-09-13 12:00:59 +0200 |
---|---|---|
committer | Andreas Kämmerle <andreas.kaemmerle@gmail.com> | 2018-09-13 12:00:59 +0200 |
commit | 87d01cc3bfc12c08024881dc8f13101e5430e3e6 (patch) | |
tree | 05e82defa51500257f97e3530862da03668895e3 /spec/javascripts/notes/components/note_form_spec.js | |
parent | fef5c923c009c64183cc43909444a1bdaba218b7 (diff) | |
parent | 71f3d48544cc0857c8d470b182f7e809de6a4642 (diff) | |
download | gitlab-ce-consolidate-page-widths-part02.tar.gz |
Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into consolidate-page-widths-part02consolidate-page-widths-part02
Diffstat (limited to 'spec/javascripts/notes/components/note_form_spec.js')
-rw-r--r-- | spec/javascripts/notes/components/note_form_spec.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/spec/javascripts/notes/components/note_form_spec.js b/spec/javascripts/notes/components/note_form_spec.js index 95d400ab3df..147ffcf1b81 100644 --- a/spec/javascripts/notes/components/note_form_spec.js +++ b/spec/javascripts/notes/components/note_form_spec.js @@ -19,7 +19,7 @@ describe('issue_note_form component', () => { props = { isEditing: false, noteBody: 'Magni suscipit eius consectetur enim et ex et commodi.', - noteId: 545, + noteId: '545', }; vm = new Component({ @@ -32,6 +32,22 @@ describe('issue_note_form component', () => { vm.$destroy(); }); + describe('noteHash', () => { + it('returns note hash string based on `noteId`', () => { + expect(vm.noteHash).toBe(`#note_${props.noteId}`); + }); + + it('return note hash as `#` when `noteId` is empty', done => { + vm.noteId = ''; + Vue.nextTick() + .then(() => { + expect(vm.noteHash).toBe('#'); + }) + .then(done) + .catch(done.fail); + }); + }); + describe('conflicts editing', () => { it('should show conflict message if note changes outside the component', done => { vm.isEditing = true; |