зеркало из https://github.com/mozilla/brackets.git
Updating CommandManager and Menu tests since duplicate id's returns null instead of throwing
This commit is contained in:
Родитель
3cb90ff986
Коммит
f65b33e3ad
|
@ -57,7 +57,7 @@ define(function (require, exports, module) {
|
|||
expect(command._commandFn).toBe(testCommandFn);
|
||||
|
||||
// duplicate command
|
||||
expect(function () { CommandManager.register("test command", commandID, testCommandFn); }).toThrow();
|
||||
expect(CommandManager.register("test command", commandID, testCommandFn)).toBeFalsy();
|
||||
|
||||
// missing arguments
|
||||
expect(function () { CommandManager.register(null, "test-command-id2", testCommandFn); }).toThrow();
|
||||
|
|
|
@ -151,13 +151,9 @@ define(function (require, exports, module) {
|
|||
expect(menu1).not.toBeNull();
|
||||
|
||||
var menu2 = null;
|
||||
var exceptionThrown = false;
|
||||
try {
|
||||
menu2 = Menus.addMenu("Custom", "menu-custom");
|
||||
} catch (e) {
|
||||
exceptionThrown = true;
|
||||
}
|
||||
expect(exceptionThrown).toBeTruthy();
|
||||
|
||||
menu2 = Menus.addMenu("Custom", "menu-custom");
|
||||
expect(menu2).toBeFalsy();
|
||||
|
||||
$listItems = testWindow.$("#main-toolbar > ul.nav").children();
|
||||
expect($listItems.length).toBe(menuCountOriginal + 1);
|
||||
|
|
Загрузка…
Ссылка в новой задаче