diff options
author | Sean Nichols <git@seanich.com> | 2018-12-14 07:52:13 +0300 |
---|---|---|
committer | Sean Nichols <git@seanich.com> | 2018-12-14 07:52:31 +0300 |
commit | 9f9eb03f3d8247438523a9fee3a83967fecd8114 (patch) | |
tree | bc86be888301dcc5935d9254ea75b1792176f27b /spec/javascripts/diffs | |
parent | ece6df18f88fd51015bb8adac1da68f944eafdfe (diff) |
Fix diff table rendering for empty files and improve tests
Diffstat (limited to 'spec/javascripts/diffs')
-rw-r--r-- | spec/javascripts/diffs/components/diff_content_spec.js | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/spec/javascripts/diffs/components/diff_content_spec.js b/spec/javascripts/diffs/components/diff_content_spec.js index a63960b3567..983b32c282e 100644 --- a/spec/javascripts/diffs/components/diff_content_spec.js +++ b/spec/javascripts/diffs/components/diff_content_spec.js @@ -58,16 +58,16 @@ describe('DiffContent', () => { it('should render a message', done => { vm.$nextTick(() => { - expect(vm.$el.querySelector('.diff-viewer .nothing-here-block')).not.toBe(null); - expect( - vm.$el.querySelector('.diff-viewer .nothing-here-block').textContent.trim(), - ).toContain('Empty file'); + const block = vm.$el.querySelector('.diff-viewer .nothing-here-block'); + + expect(block).not.toBe(null); + expect(block.textContent.trim()).toContain('Empty file'); done(); }); }); - it('should not display multiple messages', done => { + it('should not render multiple messages', done => { vm.diffFile.mode_changed = true; vm.diffFile.b_mode = '100755'; vm.diffFile.viewer.name = 'mode_changed'; @@ -78,6 +78,14 @@ describe('DiffContent', () => { done(); }); }); + + it('should not render diff table', done => { + vm.$nextTick(() => { + expect(vm.$el.querySelector('table')).toBe(null); + + done(); + }); + }); }); describe('Non-Text diffs', () => { |