Skip to content

Commit 24f5b62

Browse files
committed
Fix linter
More robust test
1 parent 89f1cf8 commit 24f5b62

File tree

4 files changed

+36
-15
lines changed

4 files changed

+36
-15
lines changed

.eslintrc.typecheck.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module.exports = {
44
project: 'tsconfig.eslint.json'
55
},
66
rules: {
7-
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }]
7+
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
8+
'jest/no-done-callback': 'off'
89
}
910
};

galata/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@
4141
"test:update": "playwright test --update-snapshots"
4242
},
4343
"dependencies": {
44-
"@jupyterlab/application": "^3.3.0-alpha.4",
45-
"@jupyterlab/cells": "^3.3.0-alpha.4",
46-
"@jupyterlab/coreutils": "^5.3.0-alpha.4",
47-
"@jupyterlab/docmanager": "^3.3.0-alpha.4",
48-
"@jupyterlab/nbformat": "^3.3.0-alpha.4",
49-
"@jupyterlab/notebook": "^3.3.0-alpha.4",
50-
"@jupyterlab/services": "^6.3.0-alpha.4",
51-
"@jupyterlab/settingregistry": "^3.3.0-alpha.4",
44+
"@jupyterlab/application": "^3.3.0-alpha.6",
45+
"@jupyterlab/cells": "^3.3.0-alpha.6",
46+
"@jupyterlab/coreutils": "^5.3.0-alpha.6",
47+
"@jupyterlab/docmanager": "^3.3.0-alpha.6",
48+
"@jupyterlab/nbformat": "^3.3.0-alpha.6",
49+
"@jupyterlab/notebook": "^3.3.0-alpha.6",
50+
"@jupyterlab/services": "^6.3.0-alpha.6",
51+
"@jupyterlab/settingregistry": "^3.3.0-alpha.6",
5252
"@lumino/algorithm": "^1.3.3",
5353
"@playwright/test": "1.14.1",
5454
"fs-extra": "^9.0.1",

galata/src/fixtures.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/ban-ts-comment */
12
// Copyright (c) Jupyter Development Team.
23
// Distributed under the terms of the Modified BSD License.
34

@@ -82,9 +83,11 @@ export type GalataOptions = {
8283
* Mock JupyterLab settings in-memory or not.
8384
*
8485
* Possible values are:
85-
* - true (default): JupyterLab settings will be mocked on a per test basis
86+
* - true: JupyterLab settings will be mocked on a per test basis
8687
* - false: JupyterLab settings won't be mocked (Be careful it will read & write settings local files)
87-
* - Record<string, unknown>: Mapping {pluginId: settings} that will override default settings
88+
* - Record<string, unknown>: Mapping {pluginId: settings} that will be default user settings
89+
*
90+
* The default value is `galata.DEFAULT_SETTINGS`
8891
*
8992
* By default the settings are stored in-memory. However the
9093
* they are still initialized with the hard drive values.
@@ -165,14 +168,16 @@ export const test: TestType<
165168
* Mock JupyterLab settings in-memory or not.
166169
*
167170
* Possible values are:
168-
* - true (default): JupyterLab settings will be mocked on a per test basis
171+
* - true: JupyterLab settings will be mocked on a per test basis
169172
* - false: JupyterLab settings won't be mocked (Be careful it may write settings local files)
170-
* - Record<string, unknown>: Mapping {pluginId: settings} that will override default settings
173+
* - Record<string, unknown>: Mapping {pluginId: settings} that will be default user settings
174+
*
175+
* The default value is `galata.DEFAULT_SETTINGS`
171176
*
172177
* By default the settings are stored in-memory. However the
173178
* they are still initialized with the hard drive values.
174179
*/
175-
mockSettings: true,
180+
mockSettings: galata.DEFAULT_SETTINGS,
176181
/**
177182
* Galata can keep the uploaded and created files in ``tmpPath`` on
178183
* the server root for debugging purpose. By default the files are kept
@@ -254,7 +259,7 @@ export const test: TestType<
254259
* JupyterLab test page.
255260
*
256261
* It brings the following feature on top of Playwright Page object:
257-
* - Goto to JupyterLab URL and wait for the application to be ready
262+
* - Goto to JupyterLab URL and wait for the application to be ready (autoGoto == true)
258263
* - Helpers for JupyterLab
259264
* - Settings mock-up
260265
* - State mock-up

galata/src/galata.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@ import { IJupyterLabPageFixture, JupyterLabPage } from './jupyterlabpage';
99
* Galata namespace
1010
*/
1111
export namespace galata {
12+
/**
13+
* Default user settings:
14+
* - Deactivate codemirror cursor blinking to avoid noise in screenshots
15+
*/
16+
export const DEFAULT_SETTINGS: Record<string, any> = {
17+
'@jupyterlab/fileeditor-extension:plugin': {
18+
editorConfig: { cursorBlinkRate: 0 }
19+
},
20+
'@jupyterlab/notebook-extension:tracker': {
21+
codeCellConfig: { cursorBlinkRate: 0 },
22+
markdownCellConfig: { cursorBlinkRate: 0 },
23+
rawCellConfig: { cursorBlinkRate: 0 }
24+
}
25+
};
26+
1227
/**
1328
* Sidebar position
1429
*/

0 commit comments

Comments
 (0)