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:
parent
15ce235eed
commit
18362eb948
3 changed files with 408 additions and 325 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue