diff options
author | Johann Hubert Sonntagbauer <johann.sonntagbauer@gmail.com> | 2018-10-09 21:03:09 +0300 |
---|---|---|
committer | Johann Hubert Sonntagbauer <johann.sonntagbauer@gmail.com> | 2018-10-17 07:57:29 +0300 |
commit | 6f5723a169b5d400c136dbd844fc54c68e5f8563 (patch) | |
tree | e7bad2648366ed5943293655a0abe23367e869a6 /spec/javascripts/diff_comments_store_spec.js | |
parent | 28d412e5b2b8499fba22e8fabb1d44f44449228e (diff) |
enable jasmine/new-line-before-expect
Diffstat (limited to 'spec/javascripts/diff_comments_store_spec.js')
-rw-r--r-- | spec/javascripts/diff_comments_store_spec.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/javascripts/diff_comments_store_spec.js b/spec/javascripts/diff_comments_store_spec.js index c6f2e66cebd..a6d363ce88e 100644 --- a/spec/javascripts/diff_comments_store_spec.js +++ b/spec/javascripts/diff_comments_store_spec.js @@ -26,6 +26,7 @@ describe('New discussion', () => { it('creates new discussion', () => { expect(Object.keys(CommentsStore.state).length).toBe(0); createDiscussion(); + expect(Object.keys(CommentsStore.state).length).toBe(1); }); @@ -34,6 +35,7 @@ describe('New discussion', () => { createDiscussion(2); const discussion = CommentsStore.state['a']; + expect(Object.keys(discussion.notes).length).toBe(2); }); }); @@ -46,6 +48,7 @@ describe('Get note', () => { it('gets note by ID', () => { const note = CommentsStore.get('a', 1); + expect(note).toBeDefined(); expect(note.id).toBe(1); }); @@ -59,17 +62,20 @@ describe('Delete discussion', () => { it('deletes discussion by ID', () => { CommentsStore.delete('a', 1); + expect(Object.keys(CommentsStore.state).length).toBe(0); }); it('deletes discussion when no more notes', () => { createDiscussion(); createDiscussion(2); + expect(Object.keys(CommentsStore.state).length).toBe(1); expect(Object.keys(CommentsStore.state['a'].notes).length).toBe(2); CommentsStore.delete('a', 1); CommentsStore.delete('a', 2); + expect(Object.keys(CommentsStore.state).length).toBe(0); }); }); @@ -84,6 +90,7 @@ describe('Update note', () => { CommentsStore.update('a', 1, false, 'test'); const note = CommentsStore.get('a', 1); + expect(note.resolved).toBe(false); }); }); @@ -96,6 +103,7 @@ describe('Discussion resolved', () => { it('is resolved with single note', () => { const discussion = CommentsStore.state['a']; + expect(discussion.isResolved()).toBe(true); }); @@ -118,6 +126,7 @@ describe('Discussion resolved', () => { createDiscussion(2, false); discussion.resolveAllNotes(); + expect(discussion.isResolved()).toBe(true); }); @@ -126,6 +135,7 @@ describe('Discussion resolved', () => { createDiscussion(2); discussion.unResolveAllNotes(); + expect(discussion.isResolved()).toBe(false); }); }); |