Example #1
0
 it('should not be emitted if the content does not change', () => {
   let model = new DocumentModel();
   let called = false;
   model.contentChanged.connect(() => { called = true; });
   model.fromString('');
   expect(called).to.be(false);
 });
Example #2
0
 it('should be emitted when the content of the model changes', () => {
   let model = new DocumentModel();
   let called = false;
   model.contentChanged.connect((sender, args) => {
     expect(sender).to.be(model);
     expect(args).to.be(void 0);
     called = true;
   });
   model.fromString('foo');
   expect(called).to.be(true);
 });
Example #3
0
 it('should deserialize the model from a string', () => {
   let model = new DocumentModel();
   model.fromString('foo');
   expect(model.toString()).to.be('foo');
 });