|
@@ -133,87 +133,87 @@ describe('common/observablejson', () => {
|
|
|
editor.dispose();
|
|
|
});
|
|
|
|
|
|
- // describe('#constructor', () => {
|
|
|
+ describe('#constructor', () => {
|
|
|
|
|
|
- // it('should create a new metadata editor', () => {
|
|
|
- // let newEditor = new ObservableJSONWidget({ editorFactory });
|
|
|
- // expect(newEditor).to.be.a(ObservableJSONWidget);
|
|
|
- // });
|
|
|
+ it('should create a new metadata editor', () => {
|
|
|
+ let newEditor = new ObservableJSONWidget({ editorFactory });
|
|
|
+ expect(newEditor).to.be.a(ObservableJSONWidget);
|
|
|
+ });
|
|
|
|
|
|
- // });
|
|
|
+ });
|
|
|
|
|
|
- // describe('#editorHostNode', () => {
|
|
|
+ describe('#editorHostNode', () => {
|
|
|
|
|
|
- // it('should be the editor host node used by the editor', () => {
|
|
|
- // expect(editor.editorHostNode.classList).to.contain('jp-ObservableJSONWidget-host');
|
|
|
- // });
|
|
|
+ it('should be the editor host node used by the editor', () => {
|
|
|
+ expect(editor.editorHostNode.classList).to.contain('jp-ObservableJSONWidget-host');
|
|
|
+ });
|
|
|
|
|
|
- // });
|
|
|
+ });
|
|
|
|
|
|
- // describe('#revertButtonNode', () => {
|
|
|
+ describe('#revertButtonNode', () => {
|
|
|
|
|
|
- // it('should be the revert button node used by the editor', () => {
|
|
|
- // expect(editor.revertButtonNode.classList).to.contain('jp-ObservableJSONWidget-revertButton');
|
|
|
- // });
|
|
|
+ it('should be the revert button node used by the editor', () => {
|
|
|
+ expect(editor.revertButtonNode.classList).to.contain('jp-ObservableJSONWidget-revertButton');
|
|
|
+ });
|
|
|
|
|
|
- // });
|
|
|
+ });
|
|
|
|
|
|
- // describe('#commitButtonNode', () => {
|
|
|
+ describe('#commitButtonNode', () => {
|
|
|
|
|
|
- // it('should be the commit button node used by the editor', () => {
|
|
|
- // expect(editor.commitButtonNode.classList).to.contain('jp-ObservableJSONWidget-commitButton');
|
|
|
- // });
|
|
|
+ it('should be the commit button node used by the editor', () => {
|
|
|
+ expect(editor.commitButtonNode.classList).to.contain('jp-ObservableJSONWidget-commitButton');
|
|
|
+ });
|
|
|
|
|
|
- // });
|
|
|
+ });
|
|
|
|
|
|
- // describe('#source', () => {
|
|
|
+ describe('#source', () => {
|
|
|
|
|
|
- // it('should be the source of the metadata', () => {
|
|
|
- // expect(editor.source).to.be(null);
|
|
|
- // });
|
|
|
+ it('should be the source of the metadata', () => {
|
|
|
+ expect(editor.source).to.be(null);
|
|
|
+ });
|
|
|
|
|
|
- // it('should be settable', () => {
|
|
|
- // let source = new ObservableJSON();
|
|
|
- // editor.source = source;
|
|
|
- // expect(editor.source).to.be(source);
|
|
|
- // });
|
|
|
+ it('should be settable', () => {
|
|
|
+ let source = new ObservableJSON();
|
|
|
+ editor.source = source;
|
|
|
+ expect(editor.source).to.be(source);
|
|
|
+ });
|
|
|
|
|
|
- // it('should update the text area value', () => {
|
|
|
- // let model = editor.model;
|
|
|
- // expect(model.value.text).to.be('No data!');
|
|
|
- // editor.source = new ObservableJSON();
|
|
|
- // expect(model.value.text).to.be('{}');
|
|
|
- // });
|
|
|
+ it('should update the text area value', () => {
|
|
|
+ let model = editor.model;
|
|
|
+ expect(model.value.text).to.be('No data!');
|
|
|
+ editor.source = new ObservableJSON();
|
|
|
+ expect(model.value.text).to.be('{}');
|
|
|
+ });
|
|
|
|
|
|
- // });
|
|
|
+ });
|
|
|
|
|
|
- // describe('#isDirty', () => {
|
|
|
+ describe('#isDirty', () => {
|
|
|
|
|
|
- // it('should test whether the editor value is dirty', () => {
|
|
|
- // expect(editor.isDirty).to.be(false);
|
|
|
- // Widget.attach(editor, document.body);
|
|
|
- // editor.model.value.text = 'a';
|
|
|
- // expect(editor.isDirty).to.be(true);
|
|
|
- // });
|
|
|
+ it('should test whether the editor value is dirty', () => {
|
|
|
+ expect(editor.isDirty).to.be(false);
|
|
|
+ Widget.attach(editor, document.body);
|
|
|
+ editor.model.value.text = 'a';
|
|
|
+ expect(editor.isDirty).to.be(true);
|
|
|
+ });
|
|
|
|
|
|
- // it('should be dirty if the value changes while focused', () => {
|
|
|
- // editor.source = new ObservableJSON();
|
|
|
- // Widget.attach(editor, document.body);
|
|
|
- // editor.editor.focus();
|
|
|
- // expect(editor.isDirty).to.be(false);
|
|
|
- // editor.source.set('foo', 1);
|
|
|
- // expect(editor.isDirty).to.be(true);
|
|
|
- // });
|
|
|
+ it('should be dirty if the value changes while focused', () => {
|
|
|
+ editor.source = new ObservableJSON();
|
|
|
+ Widget.attach(editor, document.body);
|
|
|
+ editor.editor.focus();
|
|
|
+ expect(editor.isDirty).to.be(false);
|
|
|
+ editor.source.set('foo', 1);
|
|
|
+ expect(editor.isDirty).to.be(true);
|
|
|
+ });
|
|
|
|
|
|
- // it('should not be set if not focused', () => {
|
|
|
- // editor.source = new ObservableJSON();
|
|
|
- // Widget.attach(editor, document.body);
|
|
|
- // expect(editor.isDirty).to.be(false);
|
|
|
- // editor.source.set('foo', 1);
|
|
|
- // expect(editor.isDirty).to.be(false);
|
|
|
- // });
|
|
|
+ it('should not be set if not focused', () => {
|
|
|
+ editor.source = new ObservableJSON();
|
|
|
+ Widget.attach(editor, document.body);
|
|
|
+ expect(editor.isDirty).to.be(false);
|
|
|
+ editor.source.set('foo', 1);
|
|
|
+ expect(editor.isDirty).to.be(false);
|
|
|
+ });
|
|
|
|
|
|
- // });
|
|
|
+ });
|
|
|
|
|
|
context('model.value.changed', () => {
|
|
|
|