How to use the @jupyterlab/testutils.acceptDialog 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-apputils / src / clientsession.spec.ts View on Github external
it('should present a dialog if there is no distinct kernel to start', async () => {
        // Remove the kernel preference before initializing.
        session.kernelPreference = {};

        const accept = acceptDialog();

        await session.initialize();
        await accept;
        expect(session.kernel.name).to.equal(manager.specs.default);
      });
github jupyterlab / jupyterlab / tests / test-docmanager / src / savehandler.spec.ts View on Github external
await manager.contents.save(context.path, {
            type: factory.contentType,
            format: factory.fileFormat,
            content: 'bar'
          });
          handler.saveInterval = 1;
          handler.start();
          context.model.fromString('baz');
          context.fileChanged.connect(() => {
            expect(context.model.toString()).to.equal('baz');
            delegate.resolve(undefined);
          });
        }, 1500);

        // Extend the timeout to wait for the dialog because of the setTimeout.
        await acceptDialog(document.body, 3000);
        await delegate.promise;
      });
github jupyterlab / jupyterlab-data-explorer / tests / test-apputils / src / clientsession.spec.ts View on Github external
it('should select a kernel for the session', async () => {
        await session.initialize();

        const { id, name } = session.kernel;
        const accept = acceptDialog();

        await session.selectKernel();
        await accept;

        expect(session.kernel.id).to.not.equal(id);
        expect(session.kernel.name).to.equal(name);
      });