Skip to content

Commit 2819cee

Browse files
authored
Fix the ui tests for jupyterlab 4.3 (#97)
* Fix the autocompletion test for jupyterlab 4.3 * Update snapshots
1 parent a479ded commit 2819cee

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

python/jupyterlab-collaborative-chat/ui-tests/tests/autocompletion.spec.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ const exposeDepsJs = (deps: Record<string, (...args: any) => any>): string => {
2424
// The function running in browser context to get a plugin.
2525
const getPlugin = (pluginId: string): Promise<any> => {
2626
return new Promise((resolve, reject) => {
27-
const app = window.jupyterapp;
27+
const app = window.jupyterapp as any;
2828
const hasPlugin = app.hasPlugin(pluginId);
2929

3030
if (hasPlugin) {
3131
try {
32-
const appAny = app as any;
33-
const plugin: any = appAny._plugins
34-
? appAny._plugins.get(pluginId)
35-
: undefined;
32+
// Compatibility with jupyterlab 4.3
33+
const plugin: any = app._plugins
34+
? app._plugins.get(pluginId)
35+
: app.pluginRegistry._plugins.get(pluginId);
3636
if (plugin.activated) {
3737
resolve(plugin.service);
3838
} else {
@@ -309,8 +309,10 @@ test('should use properties from autocompletion object', async ({ page }) => {
309309
});
310310

311311
test('single autocompletion should be the default', async ({ page }) => {
312+
await page.pause();
312313
await page.evaluate(
313314
async options => {
315+
console.log('YAYAYAYA');
314316
const registry = await window.getPlugin(
315317
'jupyterlab-collaborative-chat-extension:autocompletionRegistry'
316318
);
-46 Bytes
Loading
-47 Bytes
Loading

0 commit comments

Comments
 (0)