mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
improve Menu and MenuItem testing (#12015)
* split menu/menuitem and add some tests * fix ipc send issue * feedback: make tests less brittle * clean up MenuItem accelerator and label tests
This commit is contained in:
committed by
Charles Kerr
parent
15ce235eed
commit
18362eb948
@@ -228,16 +228,13 @@ const roles = {
|
||||
const canExecuteRole = (role) => {
|
||||
if (!roles.hasOwnProperty(role)) return false
|
||||
if (process.platform !== 'darwin') return true
|
||||
|
||||
// macOS handles all roles natively except for a few
|
||||
return roles[role].nonNativeMacOSRole
|
||||
}
|
||||
|
||||
exports.getDefaultLabel = (role) => {
|
||||
if (roles.hasOwnProperty(role)) {
|
||||
return roles[role].label
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
return roles.hasOwnProperty(role) ? roles[role].label : ''
|
||||
}
|
||||
|
||||
exports.getDefaultAccelerator = (role) => {
|
||||
|
||||
Reference in New Issue
Block a user