Skip to content

Commit

Permalink
Use existing server settings when creating the ConfigSection (#85)
Browse files Browse the repository at this point in the history
* Use existing server settings when creating the `ConfigSection`

* fix yarn.lock

* lint changelog

* add serviceManager to mockApp

* test

* Fix notebook integration test

* We of course dont need to select a kernel

---------

Co-authored-by: Frédéric Collonval <fcollonval@gmail.com>
  • Loading branch information
jtpio and fcollonval committed Feb 29, 2024
1 parent 465aa05 commit 3b3901e
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 17 deletions.
46 changes: 36 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,52 @@

### Enhancements made

- Enhance tour version [#81](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/81) ([@fcollonval](https://github.com/fcollonval))
- Add support for notebook 7 [#75](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/75) ([@fcollonval](https://github.com/fcollonval))
- Add notebook tours, icons [#29](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/29) ([@bollwyvl](https://github.com/bollwyvl))
- Enhance tour version
[#81](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/81)
([@fcollonval](https://github.com/fcollonval))
- Add support for notebook 7
[#75](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/75)
([@fcollonval](https://github.com/fcollonval))
- Add notebook tours, icons
[#29](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/29)
([@bollwyvl](https://github.com/bollwyvl))

### Bugs fixed

- Fix internationalization [#74](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/74) ([@fcollonval](https://github.com/fcollonval))
- Fix internationalization
[#74](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/74)
([@fcollonval](https://github.com/fcollonval))

### Maintenance and upkeep improvements

- Bump @babel/traverse from 7.22.10 to 7.23.2 [#80](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/80) ([@dependabot](https://github.com/dependabot))
- Bump postcss from 8.4.27 to 8.4.31 [#79](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/79) ([@dependabot](https://github.com/dependabot))
- Bump postcss from 8.4.27 to 8.4.31 in /ui-tests [#78](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/78) ([@dependabot](https://github.com/dependabot))
- Bump systeminformation from 5.18.10 to 5.21.8 in /ui-tests [#77](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/77) ([@dependabot](https://github.com/dependabot))
- upgrade to jupyterlab4 [#71](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/71) ([@djangoliv](https://github.com/djangoliv))
- Bump @babel/traverse from 7.22.10 to 7.23.2
[#80](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/80)
([@dependabot](https://github.com/dependabot))
- Bump postcss from 8.4.27 to 8.4.31
[#79](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/79)
([@dependabot](https://github.com/dependabot))
- Bump postcss from 8.4.27 to 8.4.31 in /ui-tests
[#78](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/78)
([@dependabot](https://github.com/dependabot))
- Bump systeminformation from 5.18.10 to 5.21.8 in /ui-tests
[#77](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/77)
([@dependabot](https://github.com/dependabot))
- upgrade to jupyterlab4
[#71](https://github.com/jupyterlab-contrib/jupyterlab-tour/pull/71)
([@djangoliv](https://github.com/djangoliv))

### Contributors to this release

([GitHub contributors page for this release](https://github.com/jupyterlab-contrib/jupyterlab-tour/graphs/contributors?from=2021-10-31&to=2023-11-08&type=c))

[@bollwyvl](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-tour+involves%3Abollwyvl+updated%3A2021-10-31..2023-11-08&type=Issues) | [@dependabot](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-tour+involves%3Adependabot+updated%3A2021-10-31..2023-11-08&type=Issues) | [@djangoliv](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-tour+involves%3Adjangoliv+updated%3A2021-10-31..2023-11-08&type=Issues) | [@fcollonval](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-tour+involves%3Afcollonval+updated%3A2021-10-31..2023-11-08&type=Issues) | [@github-actions](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-tour+involves%3Agithub-actions+updated%3A2021-10-31..2023-11-08&type=Issues)
[@bollwyvl](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-tour+involves%3Abollwyvl+updated%3A2021-10-31..2023-11-08&type=Issues)
|
[@dependabot](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-tour+involves%3Adependabot+updated%3A2021-10-31..2023-11-08&type=Issues)
|
[@djangoliv](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-tour+involves%3Adjangoliv+updated%3A2021-10-31..2023-11-08&type=Issues)
|
[@fcollonval](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-tour+involves%3Afcollonval+updated%3A2021-10-31..2023-11-08&type=Issues)
|
[@github-actions](https://github.com/search?q=repo%3Ajupyterlab-contrib%2Fjupyterlab-tour+involves%3Agithub-actions+updated%3A2021-10-31..2023-11-08&type=Issues)

<!-- <END NEW CHANGELOG ENTRY> -->
4 changes: 3 additions & 1 deletion src/__tests__/plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ISettingRegistry } from '@jupyterlab/settingregistry';
import { CommandRegistry } from '@lumino/commands';
import { ReadonlyJSONObject } from '@lumino/coreutils';
import { DocumentRegistry } from '@jupyterlab/docregistry';
import { ServerConnection } from '@jupyterlab/services';
import {
CodeMirrorEditorFactory,
CodeMirrorMimeTypeService,
Expand All @@ -34,7 +35,8 @@ function mockApp(): Partial<JupyterFrontEnd> {
return {
commands: new CommandRegistry(),
restored: Promise.resolve(),
docRegistry: new DocumentRegistry()
docRegistry: new DocumentRegistry(),
serviceManager: { serverSettings: ServerConnection.makeSettings() } as any
};
}

Expand Down
5 changes: 3 additions & 2 deletions src/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ function activate(
translator: ITranslator | null
): ITourManager {
const CONFIG_SECTION_NAME = corePlugin.id.replace(/[^\w]/g, '');
const { commands } = app;
const { commands, serviceManager } = app;

translator = translator ?? nullTranslator;

const restoreState = new PromiseDelegate<ITourState[]>();
const configReady = ConfigSection.create({
name: CONFIG_SECTION_NAME
name: CONFIG_SECTION_NAME,
serverSettings: serviceManager.serverSettings
}).catch(error => {
console.error('Failed to fetch state for jupyterlab-tour.', error);
});
Expand Down
3 changes: 1 addition & 2 deletions ui-tests/tests/notebook-tour.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ test('should run the notebook tour', async ({ page }) => {

const [notebookPage] = await Promise.all([
page.waitForEvent('popup'),
page.getByText('Notebook', { exact: true }).click()
page.getByText('Python 3 (ipykernel)').click()
]);
await notebookPage.getByRole('button', { name: 'Select Kernel' }).click();
await notebookPage.getByRole('button', { name: 'Start now' }).click();
await notebookPage.getByLabel('Next', { exact: true }).click();
await notebookPage.getByLabel('Next', { exact: true }).click();
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10668,11 +10668,11 @@ __metadata:

"typescript@patch:typescript@~5.0.4#~builtin<compat/typescript>":
version: 5.0.4
resolution: "typescript@patch:typescript@npm%3A5.0.4#~builtin<compat/typescript>::version=5.0.4&hash=b5f058"
resolution: "typescript@patch:typescript@npm%3A5.0.4#~builtin<compat/typescript>::version=5.0.4&hash=85af82"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: d26b6ba97b6d163c55dbdffd9bbb4c211667ebebc743accfeb2c8c0154aace7afd097b51165a72a5bad2cf65a4612259344ff60f8e642362aa1695c760d303ac
checksum: bb309d320c59a26565fb3793dba550576ab861018ff3fd1b7fccabbe46ae4a35546bc45f342c0a0b6f265c801ccdf64ffd68f548f117ceb7f0eac4b805cd52a9
languageName: node
linkType: hard

Expand Down

0 comments on commit 3b3901e

Please sign in to comment.