|
@@ -3,10 +3,6 @@
|
|
|
|
|
|
import expect = require('expect.js');
|
|
import expect = require('expect.js');
|
|
|
|
|
|
-import {
|
|
|
|
- nbformat
|
|
|
|
-} from '@jupyterlab/services';
|
|
|
|
-
|
|
|
|
import {
|
|
import {
|
|
Message
|
|
Message
|
|
} from 'phosphor/lib/core/messaging';
|
|
} from 'phosphor/lib/core/messaging';
|
|
@@ -19,10 +15,6 @@ import {
|
|
OutputAreaModel, OutputAreaWidget, OutputWidget
|
|
OutputAreaModel, OutputAreaWidget, OutputWidget
|
|
} from '../../../../lib/notebook/output-area';
|
|
} from '../../../../lib/notebook/output-area';
|
|
|
|
|
|
-import {
|
|
|
|
- RenderMime
|
|
|
|
-} from '../../../../lib/rendermime';
|
|
|
|
-
|
|
|
|
import {
|
|
import {
|
|
defaultRenderMime
|
|
defaultRenderMime
|
|
} from '../../utils';
|
|
} from '../../utils';
|
|
@@ -69,14 +61,6 @@ class CustomOutputWidget extends OutputWidget {
|
|
setOutput(value: Widget): void {
|
|
setOutput(value: Widget): void {
|
|
super.setOutput(value);
|
|
super.setOutput(value);
|
|
}
|
|
}
|
|
-
|
|
|
|
- getBundle(output: nbformat.IOutput): nbformat.IMimeBundle {
|
|
|
|
- return super.getBundle(output);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- convertBundle(bundle: nbformat.IMimeBundle): RenderMime.MimeMap<string> {
|
|
|
|
- return super.convertBundle(bundle);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -440,41 +424,6 @@ describe('notebook/output-area/widget', () => {
|
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
- describe('#getBundle()', () => {
|
|
|
|
-
|
|
|
|
- it('should handle all bundle types', () => {
|
|
|
|
- let widget = new CustomOutputWidget({ rendermime });
|
|
|
|
- for (let i = 0; i < DEFAULT_OUTPUTS.length; i++) {
|
|
|
|
- let output = DEFAULT_OUTPUTS[i];
|
|
|
|
- let bundle = widget.getBundle(output);
|
|
|
|
- expect(Object.keys(bundle).length).to.not.be(0);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- describe('#convertBundle()', () => {
|
|
|
|
-
|
|
|
|
- it('should handle bundles with strings', () => {
|
|
|
|
- let bundle: nbformat.IMimeBundle = {
|
|
|
|
- 'text/plain': 'foo'
|
|
|
|
- };
|
|
|
|
- let widget = new CustomOutputWidget({ rendermime });
|
|
|
|
- let map = widget.convertBundle(bundle);
|
|
|
|
- expect(map).to.eql(bundle);
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- it('should handle bundles with string arrays', () => {
|
|
|
|
- let bundle: nbformat.IMimeBundle = {
|
|
|
|
- 'text/plain': ['foo', 'bar']
|
|
|
|
- };
|
|
|
|
- let widget = new CustomOutputWidget({ rendermime });
|
|
|
|
- let map = widget.convertBundle(bundle);
|
|
|
|
- expect(map).to.eql({ 'text/plain': 'foo\nbar' });
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
});
|
|
});
|
|
|
|
|
|
});
|
|
});
|