How to use the @jupyterlab/testutils.NBTestUtils.mimeTypeService function in @jupyterlab/testutils

To help you get started, we’ve selected a few @jupyterlab/testutils 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-notebook / src / panel.spec.ts View on Github external
it('should create a notebook widget', () => {
          const options = {
            contentFactory: contentFactory,
            rendermime: NBTestUtils.defaultRenderMime(),
            mimeTypeService: NBTestUtils.mimeTypeService
          };
          expect(contentFactory.createNotebook(options)).to.be.an.instanceof(
            Notebook
          );
        });
      });
github jupyterlab / jupyterlab-data-explorer / tests / test-notebook / src / actions.spec.ts View on Github external
beforeEach(() => {
      widget = new Notebook({
        rendermime,
        contentFactory: NBTestUtils.createNotebookFactory(),
        mimeTypeService: NBTestUtils.mimeTypeService
      });
      const model = new NotebookModel();
      model.fromJSON(NBTestUtils.DEFAULT_CONTENT);
      widget.model = model;

      widget.activeCellIndex = 0;
    });
github jupyterlab / jupyterlab / tests / test-notebook / src / widgetfactory.spec.ts View on Github external
function createFactory(
  toolbarFactory?: (widget: NotebookPanel) => DocumentRegistry.IToolbarItem[]
): NotebookWidgetFactory {
  return new NotebookWidgetFactory({
    name: 'notebook',
    fileTypes: ['notebook'],
    rendermime,
    toolbarFactory,
    contentFactory,
    mimeTypeService: NBTestUtils.mimeTypeService,
    editorConfig: NBTestUtils.defaultEditorConfig
  });
}
github jupyterlab / jupyterlab-data-explorer / tests / test-notebook / src / widget.spec.ts View on Github external
import { Notebook, StaticNotebook } from '@jupyterlab/notebook';

import {
  NBTestUtils,
  framePromise,
  signalToPromise
} from '@jupyterlab/testutils';

const contentFactory = NBTestUtils.createNotebookFactory();
const editorConfig = NBTestUtils.defaultEditorConfig;
const rendermime = NBTestUtils.defaultRenderMime();

const options: Notebook.IOptions = {
  rendermime,
  contentFactory,
  mimeTypeService: NBTestUtils.mimeTypeService,
  editorConfig
};

function createWidget(): LogStaticNotebook {
  const model = new NotebookModel();
  const widget = new LogStaticNotebook(options);
  widget.model = model;
  return widget;
}

class LogStaticNotebook extends StaticNotebook {
  methods: string[] = [];

  protected onUpdateRequest(msg: Message): void {
    super.onUpdateRequest(msg);
    this.methods.push('onUpdateRequest');
github jupyterlab / jupyterlab / tests / test-notebook / src / widget.spec.ts View on Github external
import { Notebook, StaticNotebook } from '@jupyterlab/notebook';

import {
  NBTestUtils,
  framePromise,
  signalToPromise
} from '@jupyterlab/testutils';

const contentFactory = NBTestUtils.createNotebookFactory();
const editorConfig = NBTestUtils.defaultEditorConfig;
const rendermime = NBTestUtils.defaultRenderMime();

const options: Notebook.IOptions = {
  rendermime,
  contentFactory,
  mimeTypeService: NBTestUtils.mimeTypeService,
  editorConfig
};

function createWidget(): LogStaticNotebook {
  const model = new NotebookModel();
  const widget = new LogStaticNotebook(options);
  widget.model = model;
  return widget;
}

class LogStaticNotebook extends StaticNotebook {
  methods: string[] = [];

  protected onUpdateRequest(msg: Message): void {
    super.onUpdateRequest(msg);
    this.methods.push('onUpdateRequest');
github jupyterlab / jupyterlab / tests / test-notebook / src / actions.spec.ts View on Github external
beforeEach(() => {
      widget = new Notebook({
        rendermime,
        contentFactory: NBTestUtils.createNotebookFactory(),
        mimeTypeService: NBTestUtils.mimeTypeService
      });
      const model = new NotebookModel();
      model.fromJSON(NBTestUtils.DEFAULT_CONTENT);
      widget.model = model;

      widget.activeCellIndex = 0;
    });