diff options
author | Phil Hughes <me@iamphill.com> | 2019-01-11 10:14:51 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-01-11 10:14:51 +0000 |
commit | 8d1683f7b0173040b660a9b61e9a2d5389e1344a (patch) | |
tree | 281448892732f68a115f025c04078b7f82d6001e /spec | |
parent | b682a6f8981d303e7ee7ecc4273768ee6ed66864 (diff) | |
download | gitlab-ce-8d1683f7b0173040b660a9b61e9a2d5389e1344a.tar.gz |
Support multiple outputs in Jupyter notebooks
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/31910, https://gitlab.com/gitlab-org/gitlab-ce/issues/32588
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/notebook/cells/output/html_spec.js | 2 | ||||
-rw-r--r-- | spec/javascripts/notebook/cells/output/index_spec.js | 27 |
2 files changed, 10 insertions, 19 deletions
diff --git a/spec/javascripts/notebook/cells/output/html_spec.js b/spec/javascripts/notebook/cells/output/html_spec.js index bea62f54634..3ee404fb187 100644 --- a/spec/javascripts/notebook/cells/output/html_spec.js +++ b/spec/javascripts/notebook/cells/output/html_spec.js @@ -9,6 +9,8 @@ describe('html output cell', () => { return new Component({ propsData: { rawCode, + count: 0, + index: 0, }, }).$mount(); } diff --git a/spec/javascripts/notebook/cells/output/index_spec.js b/spec/javascripts/notebook/cells/output/index_spec.js index feab7ad4212..005569f1c2d 100644 --- a/spec/javascripts/notebook/cells/output/index_spec.js +++ b/spec/javascripts/notebook/cells/output/index_spec.js @@ -10,7 +10,7 @@ describe('Output component', () => { const createComponent = output => { vm = new Component({ propsData: { - output, + outputs: [].concat(output), count: 1, }, }); @@ -51,28 +51,21 @@ describe('Output component', () => { it('renders as an image', () => { expect(vm.$el.querySelector('img')).not.toBeNull(); }); - - it('does not render the prompt', () => { - expect(vm.$el.querySelector('.prompt span')).toBeNull(); - }); }); describe('html output', () => { - beforeEach(done => { + it('renders raw HTML', () => { createComponent(json.cells[4].outputs[0]); - setTimeout(() => { - done(); - }); - }); - - it('renders raw HTML', () => { expect(vm.$el.querySelector('p')).not.toBeNull(); - expect(vm.$el.textContent.trim()).toBe('test'); + expect(vm.$el.querySelectorAll('p').length).toBe(1); + expect(vm.$el.textContent.trim()).toContain('test'); }); - it('does not render the prompt', () => { - expect(vm.$el.querySelector('.prompt span')).toBeNull(); + it('renders multiple raw HTML outputs', () => { + createComponent([json.cells[4].outputs[0], json.cells[4].outputs[0]]); + + expect(vm.$el.querySelectorAll('p').length).toBe(2); }); }); @@ -88,10 +81,6 @@ describe('Output component', () => { it('renders as an svg', () => { expect(vm.$el.querySelector('svg')).not.toBeNull(); }); - - it('does not render the prompt', () => { - expect(vm.$el.querySelector('.prompt span')).toBeNull(); - }); }); describe('default to plain text', () => { |