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:
shelley vohr 2018-02-23 08:53:59 -05:00 committed by Charles Kerr
parent 15ce235eed
commit 18362eb948
3 changed files with 408 additions and 325 deletions

View file

@ -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) => {