Skip to content

Commit

Permalink
Fix notebook tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brichet committed Jun 20, 2024
1 parent 0230bbf commit 4f95326
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
8 changes: 5 additions & 3 deletions nbgrader/tests/ui-tests/create_assignement.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ test.beforeEach(async ({ request, tmpPath }) => {
test.afterEach(async ({ request, page, tmpPath }) => {
if (request === undefined) throw new Error("Request is undefined.");

// Close opened notebook.
while (await page.notebook.isAnyActive()) {
await page.notebook.close();
if (!notebookTest) {
// Close opened notebook.
while (await page.notebook.isAnyActive()) {
await page.notebook.close();
}
}

const contents = galata.newContentsHelper(request, page);
Expand Down
3 changes: 1 addition & 2 deletions nbgrader/tests/ui-tests/formgrader.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const tempPath = 'nbgrader-formgrader-test';

let test = jupyterLabTest;
let mainPanelId = '#jp-main-dock-panel';
let menuPanelId = '#jp-menu-panel';
let menuPanelId = '#jp-MainMenu';
let mainPanelTabCount = 1;

const baseTestUse = {
Expand All @@ -41,7 +41,6 @@ if (isNotebook) {
autoGoto: false
});
mainPanelId = '#main-panel';
menuPanelId = '#menu-panel';
mainPanelTabCount = 2;
}
else {
Expand Down
8 changes: 5 additions & 3 deletions nbgrader/tests/ui-tests/validate_assignment.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ test.beforeEach(async ({ request, tmpPath }) => {
test.afterEach(async ({ request, page, tmpPath }) => {
if (request === undefined) throw new Error("Request is undefined.");

// Close opened notebook.
while (await page.notebook.isAnyActive()) {
await page.notebook.close();
if (!notebookTest) {
// Close opened notebook.
while (await page.notebook.isAnyActive()) {
await page.notebook.close();
}
}

const contents = galata.newContentsHelper(request, page);
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ const availableExtensionsManager: JupyterFrontEndPlugin<void> = {
activate: (
app: JupyterFrontEnd,
mainMenu: IMainMenu,
palette: ICommandPalette,
labShell: ILabShell,
notebookShell: INotebookShell
palette: ICommandPalette | null,
labShell: ILabShell | null,
notebookShell: INotebookShell | null
) => {

let mainExtensions = false;
Expand Down

0 comments on commit 4f95326

Please sign in to comment.