diff options
author | André Luís <me@andr3.net> | 2019-08-12 02:46:49 +0300 |
---|---|---|
committer | Paul Slaughter <pslaughter@gitlab.com> | 2019-08-12 02:46:49 +0300 |
commit | ccce365ac5b5783031c84b950548a4a4940a787e (patch) | |
tree | cb336aa0d7d58f65815ea14e45ac7ebd395d1910 /spec | |
parent | 22dc7a0ca8ca9213e255b5d316ad9bbdc05cf41f (diff) |
Update karma for new expansion cell markup
Also cleans up spec by:
- Add missing `afterEach ... $destroy`
- Add missing `done` call when `$nextTick` was used
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/diffs/components/diff_file_spec.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/spec/javascripts/diffs/components/diff_file_spec.js b/spec/javascripts/diffs/components/diff_file_spec.js index ef4589ada48..18da0a473d6 100644 --- a/spec/javascripts/diffs/components/diff_file_spec.js +++ b/spec/javascripts/diffs/components/diff_file_spec.js @@ -15,8 +15,12 @@ describe('DiffFile', () => { }).$mount(); }); + afterEach(() => { + vm.$destroy(); + }); + describe('template', () => { - it('should render component with file header, file content components', () => { + it('should render component with file header, file content components', done => { const el = vm.$el; const { file_hash, file_path } = vm.file; @@ -30,9 +34,13 @@ describe('DiffFile', () => { vm.file.renderIt = true; - vm.$nextTick(() => { - expect(el.querySelectorAll('.line_content').length).toBeGreaterThan(5); - }); + vm.$nextTick() + .then(() => { + expect(el.querySelectorAll('.line_content').length).toBeGreaterThanOrEqual(5); + expect(el.querySelectorAll('.js-line-expansion-content').length).toBe(1); + }) + .then(done) + .catch(done.fail); }); describe('collapsed', () => { |