1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Make unit tests for tray behave correctly when item is disabled

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen 2022-06-17 16:09:58 +03:00
parent 10ba9ef853
commit 0d469f1b28
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A
2 changed files with 5 additions and 1 deletions

View File

@ -72,7 +72,7 @@ const toItemInjectablesFor = (extension: LensMainExtension, installationCounter:
return decorated(registration); return decorated(registration);
}, },
enabled: computed(() => !!registration.enabled), enabled: computed(() => registration.enabled ?? true),
visible: computed(() => true), visible: computed(() => true),
extension, extension,

View File

@ -317,6 +317,10 @@ export const getApplicationBuilder = () => {
throw new Error(`Tried to click tray menu item with ID ${id} which does not exist. Available IDs are: "${availableIds}"`); throw new Error(`Tried to click tray menu item with ID ${id} which does not exist. Available IDs are: "${availableIds}"`);
} }
if (!menuItem.enabled.get()) {
throw new Error(`Tried to click tray menu item with ID ${id} which is disabled.`);
}
await menuItem.click?.(); await menuItem.click?.();
}, },
}, },