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:
parent
10ba9ef853
commit
0d469f1b28
@ -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?.();
|
||||
},
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user