fix: crash when generating shortcut text for super accelerator (#44341)

This commit is contained in:
Robo 2024-10-22 03:26:38 +09:00 committed by GitHub
parent cc9d85d3ca
commit 3e77faf2f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 66 additions and 1 deletions

View file

@ -926,6 +926,20 @@ describe('Menu module', function () {
});
w.show();
});
it('does not crash when rendering menu item with Super or meta accelerator', async () => {
const menu = Menu.buildFromTemplate([{
label: 'Test Super',
accelerator: 'Super+Ctrl+T'
}, {
label: 'Test Meta',
accelerator: 'Meta+Ctrl+T'
}]);
const menuWillClose = once(menu, 'menu-will-close');
menu.popup({ window: w });
menu.closePopup();
await menuWillClose;
});
});
describe('Menu.setApplicationMenu', () => {