Skip to content

Commit

Permalink
Fix linter
Browse files Browse the repository at this point in the history
More robust test
  • Loading branch information
fcollonval committed Aug 26, 2021
1 parent 89f1cf8 commit 24f5b62
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.typecheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
project: 'tsconfig.eslint.json'
},
rules: {
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }]
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
'jest/no-done-callback': 'off'
}
};
16 changes: 8 additions & 8 deletions galata/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
"test:update": "playwright test --update-snapshots"
},
"dependencies": {
"@jupyterlab/application": "^3.3.0-alpha.4",
"@jupyterlab/cells": "^3.3.0-alpha.4",
"@jupyterlab/coreutils": "^5.3.0-alpha.4",
"@jupyterlab/docmanager": "^3.3.0-alpha.4",
"@jupyterlab/nbformat": "^3.3.0-alpha.4",
"@jupyterlab/notebook": "^3.3.0-alpha.4",
"@jupyterlab/services": "^6.3.0-alpha.4",
"@jupyterlab/settingregistry": "^3.3.0-alpha.4",
"@jupyterlab/application": "^3.3.0-alpha.6",
"@jupyterlab/cells": "^3.3.0-alpha.6",
"@jupyterlab/coreutils": "^5.3.0-alpha.6",
"@jupyterlab/docmanager": "^3.3.0-alpha.6",
"@jupyterlab/nbformat": "^3.3.0-alpha.6",
"@jupyterlab/notebook": "^3.3.0-alpha.6",
"@jupyterlab/services": "^6.3.0-alpha.6",
"@jupyterlab/settingregistry": "^3.3.0-alpha.6",
"@lumino/algorithm": "^1.3.3",
"@playwright/test": "1.14.1",
"fs-extra": "^9.0.1",
Expand Down
17 changes: 11 additions & 6 deletions galata/src/fixtures.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

Expand Down Expand Up @@ -82,9 +83,11 @@ export type GalataOptions = {
* Mock JupyterLab settings in-memory or not.
*
* Possible values are:
* - true (default): JupyterLab settings will be mocked on a per test basis
* - true: JupyterLab settings will be mocked on a per test basis
* - false: JupyterLab settings won't be mocked (Be careful it will read & write settings local files)
* - Record<string, unknown>: Mapping {pluginId: settings} that will override default settings
* - Record<string, unknown>: Mapping {pluginId: settings} that will be default user settings
*
* The default value is `galata.DEFAULT_SETTINGS`
*
* By default the settings are stored in-memory. However the
* they are still initialized with the hard drive values.
Expand Down Expand Up @@ -165,14 +168,16 @@ export const test: TestType<
* Mock JupyterLab settings in-memory or not.
*
* Possible values are:
* - true (default): JupyterLab settings will be mocked on a per test basis
* - true: JupyterLab settings will be mocked on a per test basis
* - false: JupyterLab settings won't be mocked (Be careful it may write settings local files)
* - Record<string, unknown>: Mapping {pluginId: settings} that will override default settings
* - Record<string, unknown>: Mapping {pluginId: settings} that will be default user settings
*
* The default value is `galata.DEFAULT_SETTINGS`
*
* By default the settings are stored in-memory. However the
* they are still initialized with the hard drive values.
*/
mockSettings: true,
mockSettings: galata.DEFAULT_SETTINGS,
/**
* Galata can keep the uploaded and created files in ``tmpPath`` on
* the server root for debugging purpose. By default the files are kept
Expand Down Expand Up @@ -254,7 +259,7 @@ export const test: TestType<
* JupyterLab test page.
*
* It brings the following feature on top of Playwright Page object:
* - Goto to JupyterLab URL and wait for the application to be ready
* - Goto to JupyterLab URL and wait for the application to be ready (autoGoto == true)
* - Helpers for JupyterLab
* - Settings mock-up
* - State mock-up
Expand Down
15 changes: 15 additions & 0 deletions galata/src/galata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ import { IJupyterLabPageFixture, JupyterLabPage } from './jupyterlabpage';
* Galata namespace
*/
export namespace galata {
/**
* Default user settings:
* - Deactivate codemirror cursor blinking to avoid noise in screenshots
*/
export const DEFAULT_SETTINGS: Record<string, any> = {
'@jupyterlab/fileeditor-extension:plugin': {
editorConfig: { cursorBlinkRate: 0 }
},
'@jupyterlab/notebook-extension:tracker': {
codeCellConfig: { cursorBlinkRate: 0 },
markdownCellConfig: { cursorBlinkRate: 0 },
rawCellConfig: { cursorBlinkRate: 0 }
}
};

/**
* Sidebar position
*/
Expand Down

0 comments on commit 24f5b62

Please sign in to comment.