forked from jupyterlab/jupyterlab
/
mimemodel.spec.ts
43 lines (37 loc) · 1.15 KB
/
mimemodel.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
import { expect } from 'chai';
import { MimeModel } from '@jupyterlab/rendermime';
describe('rendermime/mimemodel', () => {
describe('MimeModel', () => {
describe('#constructor()', () => {
it('should create a new mime model', () => {
const model = new MimeModel();
expect(model).to.be.an.instanceof(MimeModel);
});
it('should accept arguments', () => {
const model = new MimeModel({
data: { foo: 1 },
metadata: { bar: 'baz' }
});
expect(model).to.be.an.instanceof(MimeModel);
});
});
describe('#data', () => {
it('should be the data observable map', () => {
const model = new MimeModel({
data: { bar: 'baz' }
});
expect(model.data['bar']).to.equal('baz');
});
});
describe('#metadata', () => {
it('should be the metadata observable map', () => {
const model = new MimeModel({
metadata: { bar: 'baz' }
});
expect(model.metadata['bar']).to.equal('baz');
});
});
});
});