Merge pull request #4840 from atom/undefined-menu-accelerator

Undefined menu accelerator
This commit is contained in:
Cheng Zhao 2016-03-21 21:02:44 +09:00
commit e08b48ab48
2 changed files with 19 additions and 4 deletions

View file

@ -32,6 +32,21 @@ describe('menu module', function() {
]);
});
it('does not throw exceptions for undefined/null values', function() {
assert.doesNotThrow(function() {
Menu.buildFromTemplate([
{
label: 'text',
accelerator: undefined
},
{
label: 'text again',
accelerator: null
}
]);
});
});
describe('Menu.buildFromTemplate should reorder based on item position specifiers', function() {
it('should position before existing item', function() {
var menu = Menu.buildFromTemplate([