summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2019-01-11 13:02:26 +0000
committerFilipa Lacerda <filipa@gitlab.com>2019-01-11 13:02:26 +0000
commite593e14a101b5342ad1f502fb086c89329bb9c68 (patch)
tree5b27f3cd69b3b5fe1fa2cec955f30e7d0310cfc6 /spec
parent7e1b5f4282d229c5f9ddbaf8adeba6fcd2807bf0 (diff)
parent8d1683f7b0173040b660a9b61e9a2d5389e1344a (diff)
downloadgitlab-ce-e593e14a101b5342ad1f502fb086c89329bb9c68.tar.gz
Merge branch 'notebook-multiple-outputs' into 'master'
Support multiple outputs in Jupyter notebooks Closes #32588 and #31910 See merge request gitlab-org/gitlab-ce!24263
Diffstat (limited to 'spec')
-rw-r--r--spec/javascripts/notebook/cells/output/html_spec.js2
-rw-r--r--spec/javascripts/notebook/cells/output/index_spec.js27
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', () => {