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 committed 2022-06-17 16:18:03 +03:00
1 parent 10ba9ef853
commit 0d469f1b28
2 files changed
+5 -1

No files matched your search

@@ -72,7 +72,7 @@ const toItemInjectablesFor = (extension: LensMainExtension, installationCounter:
return decorated(registration);
},
enabled: computed(() => !!registration.enabled),
enabled: computed(() => registration.enabled ?? true),
visible: computed(() => true),
extension,
@@ -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}"`);
}
if (!menuItem.enabled.get()) {
throw new Error(`Tried to click tray menu item with ID ${id} which is disabled.`);
}
await menuItem.click?.();
},
},