diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-05 21:08:13 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-05 21:08:13 +0000 |
commit | d3c29eae5c389e36d4751539fad0462053fb2b20 (patch) | |
tree | cc3ae497193f9334d0bc6ee4224637102f6e0d4e /spec/javascripts | |
parent | ad4dbe36445360521fc73a57df13bc8f12eeaa92 (diff) | |
download | gitlab-ce-d3c29eae5c389e36d4751539fad0462053fb2b20.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/diffs/components/diff_file_spec.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/javascripts/diffs/components/diff_file_spec.js b/spec/javascripts/diffs/components/diff_file_spec.js index eab4f4fb17f..e2b64a5418e 100644 --- a/spec/javascripts/diffs/components/diff_file_spec.js +++ b/spec/javascripts/diffs/components/diff_file_spec.js @@ -23,6 +23,9 @@ describe('DiffFile', () => { vm.$destroy(); }); + const findDiffContent = () => vm.$el.querySelector('.diff-content'); + const isVisible = el => el.style.display !== 'none'; + describe('template', () => { it('should render component with file header, file content components', done => { const el = vm.$el; @@ -69,13 +72,13 @@ describe('DiffFile', () => { describe('collapsed', () => { it('should not have file content', done => { - expect(vm.$el.querySelectorAll('.diff-content').length).toEqual(1); + expect(isVisible(findDiffContent())).toBe(true); expect(vm.isCollapsed).toEqual(false); vm.isCollapsed = true; vm.file.renderIt = true; vm.$nextTick(() => { - expect(vm.$el.querySelectorAll('.diff-content').length).toEqual(0); + expect(isVisible(findDiffContent())).toBe(false); done(); }); |