Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
});
// The server has a one second resolution for saves.
setTimeout(async () => {
await manager.contents.save(context.path, {
type: factory.contentType,
format: factory.fileFormat,
content: 'bar'
});
handler.saveInterval = 1;
handler.start();
context.model.fromString('baz');
}, 1500);
// Extend the timeout to wait for the dialog because of the setTimeout.
await waitForDialog(document.body, 3000);
revert();
await delegate.promise;
});
});
it('should be editable', async () => {
const node = document.createElement('div');
document.body.appendChild(node);
const prompt = InputDialog.getNumber({
label: 'text',
title: 'Pick a number',
host: node
});
await waitForDialog(node);
const body = node.getElementsByClassName('jp-Input-Dialog').item(0)!;
const input = body.getElementsByTagName('input').item(0)!;
input.value = '25';
await acceptDialog();
const result = await prompt;
expect(result.button.accept).toBe(true);
expect(result.value).toBe(25);
document.body.removeChild(node);
});
it.skip('should attach the dialog to the host', async () => {
const host = document.createElement('div');
const dialog = new TestDialog({ host });
document.body.appendChild(host);
void dialog.launch();
await waitForDialog(host);
expect(host.contains(dialog.node)).toBe(true);
dialog.dispose();
document.body.removeChild(host);
});
it.skip('should attach the dialog to the host', async () => {
const host = document.createElement('div');
const dialog = new TestDialog({ host });
document.body.appendChild(host);
void dialog.launch();
await waitForDialog(host);
expect(host.contains(dialog.node)).toBe(true);
dialog.dispose();
document.body.removeChild(host);
});