How to use the @jupyterlab/docregistry.DocumentModel function in @jupyterlab/docregistry

To help you get started, we’ve selected a few @jupyterlab/docregistry examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jupyterlab / jupyterlab / tests / test-docregistry / src / default.spec.ts View on Github external
it('should serialize the model to a string', () => {
        const model = new DocumentModel();
        expect(model.toString()).to.equal('');
      });
    });
github jupyterlab / jupyterlab / tests / test-docregistry / src / default.spec.ts View on Github external
it('should be safe to call more than once', () => {
        const model = new DocumentModel();
        model.dispose();
        model.dispose();
        expect(model.isDisposed).to.equal(true);
      });
    });
github jupyterlab / jupyterlab-data-explorer / tests / test-docregistry / src / default.spec.ts View on Github external
it('should serialize the model to a string', () => {
        const model = new DocumentModel();
        expect(model.toString()).to.equal('');
      });
    });
github jupyterlab / jupyterlab / tests / test-docregistry / src / default.spec.ts View on Github external
it('should emit `stateChanged` when changed', () => {
        const model = new DocumentModel();
        let called = false;
        model.stateChanged.connect((sender, args) => {
          expect(sender).to.equal(model);
          expect(args.name).to.equal('readOnly');
          expect(args.oldValue).to.equal(false);
          expect(args.newValue).to.equal(true);
          called = true;
        });
        model.readOnly = true;
        expect(called).to.equal(true);
      });
github jupyterlab / jupyterlab-data-explorer / tests / test-docregistry / src / default.spec.ts View on Github external
it('should accept an optional language preference', () => {
        const model = new DocumentModel('foo');
        expect(model.defaultKernelLanguage).to.equal('foo');
      });
    });
github yuvipanda / simplest-notebook / test / src / docregistry / default.spec.ts View on Github external
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);
      });
github yuvipanda / simplest-notebook / test / src / docregistry / default.spec.ts View on Github external
it('should get the default kernel langauge of the document', () => {
        let model = new DocumentModel();
        expect(model.defaultKernelLanguage).to.be('');
      });
github yuvipanda / simplest-notebook / test / src / docregistry / default.spec.ts View on Github external
it('should get the read only state of the document', () => {
        let model = new DocumentModel();
        expect(model.readOnly).to.be(false);
      });
github yuvipanda / simplest-notebook / test / src / docregistry / default.spec.ts View on Github external
it('should be set by the constructor arg', () => {
        let model = new DocumentModel('foo');
        expect(model.defaultKernelLanguage).to.be('foo');
      });
github jupyterlab / jupyterlab / tests / test-docregistry / src / default.spec.ts View on Github external
it('should get the dirty state of the document', () => {
        const model = new DocumentModel();
        expect(model.dirty).to.equal(false);
      });