Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
it('should construct a new filtered file browser model', () => {
let model = new FilterFileBrowserModel({ iconRegistry, manager });
expect(model).to.be.an.instanceof(FilterFileBrowserModel);
});