diff options
author | Phil Hughes <me@iamphill.com> | 2017-11-01 13:03:19 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-11-01 13:03:19 +0000 |
commit | 984f3b7dffc24636604e406b2240e2ae2e1b5f84 (patch) | |
tree | 134df56cab4feca7676b57b52cdb4ddc7b9fecd8 /spec | |
parent | e457f3fbffddb84357e9449c66c2af675fbb526b (diff) | |
download | gitlab-ce-multi-file-editor-binary-editor.tar.gz |
Fix binary files not showing anything in edit modemulti-file-editor-binary-editor
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/repo/components/repo_editor_spec.js | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/spec/javascripts/repo/components/repo_editor_spec.js b/spec/javascripts/repo/components/repo_editor_spec.js index 82f914b7c9d..979d2185076 100644 --- a/spec/javascripts/repo/components/repo_editor_spec.js +++ b/spec/javascripts/repo/components/repo_editor_spec.js @@ -17,6 +17,7 @@ describe('RepoEditor', () => { f.active = true; f.tempFile = true; vm.$store.state.openFiles.push(f); + vm.$store.getters.activeFile.html = 'testing'; vm.monaco = true; vm.$mount(); @@ -31,18 +32,25 @@ describe('RepoEditor', () => { it('renders an ide container', (done) => { Vue.nextTick(() => { expect(vm.shouldHideEditor).toBeFalsy(); + expect(vm.$el.textContent.trim()).toBe(''); + done(); }); }); describe('when open file is binary and not raw', () => { - it('does not render the IDE', (done) => { + beforeEach((done) => { vm.$store.getters.activeFile.binary = true; - Vue.nextTick(() => { - expect(vm.shouldHideEditor).toBeTruthy(); - done(); - }); + Vue.nextTick(done); + }); + + it('does not render the IDE', () => { + expect(vm.shouldHideEditor).toBeTruthy(); + }); + + it('shows activeFile html', () => { + expect(vm.$el.textContent.trim()).toBe('testing'); }); }); }); |