Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollonval committed Nov 14, 2023
1 parent 6959868 commit 6deefca
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
5 changes: 5 additions & 0 deletions shout-button-message/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ a widget in the status bar.

![preview](./preview.jpg)

We strongly advice to look to those examples before diving into this one:

- [signals](../signals/): Communication between JavaScript objects.
- [widgets](../widgets): The basic DOM Jupyter component

## Jupyter Notebook / JupyterLab compatibility

As Jupyter Notebook 7+ is built with components from JupyterLab, and since
Expand Down
2 changes: 1 addition & 1 deletion shout-button-message/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "hatchling.build"
[project]
name = "jupyterlab_examples_shout_button"
readme = "README.md"
license = { file = "LICENSE" }
license = {text = "BSD-3-Clause License"}
requires-python = ">=3.8"
classifiers = [
"Framework :: Jupyter",
Expand Down
17 changes: 11 additions & 6 deletions widgets/ui-tests/tests/widgets.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,20 @@ test('should open a widget panel', async ({ page }) => {
// Open a new tab from menu
await page.menu.clickMenuItem('Widget Example>Open a Tab Widget');

await page.getByRole('main').getByText('Widget Example View');

let gotAlerted = false;
let resolveAlert: (arg0: boolean) => void;
const gotAlerted = new Promise<boolean>(resolve => {
resolveAlert = resolve;
});
page.on('dialog', dialog => {
gotAlerted = dialog.message() == 'You clicked on the widget';
if (dialog.message() == 'You clicked on the widget') {
resolveAlert(true);
}
dialog.accept();
});
await page.getByRole('main').locator('.jp-example-view').click();

expect(gotAlerted).toEqual(true);
await page.getByRole('main').getByLabel('Widget Example View').click();

expect(await gotAlerted).toEqual(true);

expect(await page.screenshot()).toMatchSnapshot('widgets-example.png');

Check failure on line 28 in widgets/ui-tests/tests/widgets.spec.ts

View workflow job for this annotation

GitHub Actions / build_extensions (widgets, ubuntu-latest)

tests/widgets.spec.ts:3:5 › should open a widget panel

1) tests/widgets.spec.ts:3:5 › should open a widget panel ──────────────────────────────────────── Error: Screenshot comparison failed: 2527 pixels (ratio 0.01 of all image pixels) are different. Expected: /home/runner/work/extension-examples/extension-examples/widgets/ui-tests/tests/widgets.spec.ts-snapshots/widgets-example-linux.png Received: /home/runner/work/extension-examples/extension-examples/widgets/ui-tests/test-results/tests-widgets-should-open-a-widget-panel/widgets-example-actual.png Diff: /home/runner/work/extension-examples/extension-examples/widgets/ui-tests/test-results/tests-widgets-should-open-a-widget-panel/widgets-example-diff.png 26 | expect(await gotAlerted).toEqual(true); 27 | > 28 | expect(await page.screenshot()).toMatchSnapshot('widgets-example.png'); | ^ 29 | }); 30 | at /home/runner/work/extension-examples/extension-examples/widgets/ui-tests/tests/widgets.spec.ts:28:35
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6deefca

Please sign in to comment.