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 create a banner cell', () => {
let model = new RawCellModel({});
let banner = contentFactory.createBanner({
model,
contentFactory: contentFactory.rawCellContentFactory
}, widget);
expect(banner).to.be.a(RawCellWidget);
});
it('should create a raw cell widget', () => {
const model = new RawCellModel({});
const widget = new RawCell({ model, contentFactory }).initializeState();
expect(widget).toBeInstanceOf(RawCell);
});
});
it('should be set with type "raw"', () => {
let model = new RawCellModel({});
expect(model.type).to.be('raw');
});
it('should create a `RawCell`', () => {
const contentFactory = new StaticNotebook.ContentFactory();
const model = new RawCellModel({});
const rawOptions = { model, contentFactory };
const parent = new StaticNotebook(options);
const widget = contentFactory.createRawCell(rawOptions, parent);
expect(widget).to.be.an.instanceof(RawCell);
});
});
it('should create a `RawCell`', () => {
const contentFactory = new StaticNotebook.ContentFactory();
const model = new RawCellModel({});
const rawOptions = { model, contentFactory };
const parent = new StaticNotebook(options);
const widget = contentFactory.createRawCell(rawOptions, parent);
expect(widget).to.be.an.instanceof(RawCell);
});
});
createRawCell(options: CellModel.IOptions): IRawCellModel {
if (this.modelDB) {
if (!options.id) {
options.id = UUID.uuid4();
}
options.modelDB = this.modelDB.view(options.id);
}
return new RawCellModel(options);
}
createRawCell(options: CellModel.IOptions): IRawCellModel {
if (this.modelDB) {
if (!options.id) {
options.id = UUID.uuid4();
}
options.modelDB = this.modelDB.view(options.id);
let cell;
this.modelDB.withTransaction(() => {
cell = new RawCellModel(options);
});
return cell;
}
return new RawCellModel(options);
}
createRawCell(options: CellModel.IOptions): IRawCellModel {
return new RawCellModel(options);
}
}
createRawCell(options: CellModel.IOptions): IRawCellModel {
if (this.modelDB) {
if (!options.id) {
options.id = UUID.uuid4();
}
options.modelDB = this.modelDB.view(options.id);
}
return new RawCellModel(options);
}
createRawCell(options: CellModel.IOptions): IRawCellModel {
return new RawCellModel(options);
}
}