Skip to content

Commit

Permalink
Fix the ui tests for jupyterlab 4.3 (#97)
Browse files Browse the repository at this point in the history
* Fix the autocompletion test for jupyterlab 4.3

* Update snapshots
  • Loading branch information
brichet authored Nov 6, 2024
1 parent a479ded commit 2819cee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ const exposeDepsJs = (deps: Record<string, (...args: any) => any>): string => {
// The function running in browser context to get a plugin.
const getPlugin = (pluginId: string): Promise<any> => {
return new Promise((resolve, reject) => {
const app = window.jupyterapp;
const app = window.jupyterapp as any;
const hasPlugin = app.hasPlugin(pluginId);

if (hasPlugin) {
try {
const appAny = app as any;
const plugin: any = appAny._plugins
? appAny._plugins.get(pluginId)
: undefined;
// Compatibility with jupyterlab 4.3
const plugin: any = app._plugins
? app._plugins.get(pluginId)
: app.pluginRegistry._plugins.get(pluginId);
if (plugin.activated) {
resolve(plugin.service);
} else {
Expand Down Expand Up @@ -309,8 +309,10 @@ test('should use properties from autocompletion object', async ({ page }) => {
});

test('single autocompletion should be the default', async ({ page }) => {
await page.pause();
await page.evaluate(
async options => {
console.log('YAYAYAYA');
const registry = await window.getPlugin(
'jupyterlab-collaborative-chat-extension:autocompletionRegistry'
);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 2819cee

Please sign in to comment.