How to use the @jupyterlab/filebrowser.FilterFileBrowserModel function in @jupyterlab/filebrowser

To help you get started, we’ve selected a few @jupyterlab/filebrowser 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-filebrowser / src / openfiledialog.spec.ts View on Github external
it('should respect the filter', async () => {
        let filteredModel = new FilterFileBrowserModel({
          iconRegistry,
          manager,
          filter: (model: Contents.IModel) => model.type === 'notebook'
        });
        await filteredModel.cd();
        let model = new FileBrowserModel({ iconRegistry, manager });
        await model.cd();

        const filteredItems = toArray(
          filteredModel.items()
        ) as Contents.IModel[];
        const items = toArray(model.items());
        const shownItems = items.filter(
          item => item.type === 'directory' || item.type === 'notebook'
        );
        expect(filteredItems.length).equal(shownItems.length);
github jupyterlab / jupyterlab / tests / test-filebrowser / src / openfiledialog.spec.ts View on Github external
it('should construct a new filtered file browser model', () => {
        let model = new FilterFileBrowserModel({ iconRegistry, manager });
        expect(model).to.be.an.instanceof(FilterFileBrowserModel);
      });