Updating CommandManager and Menu tests since duplicate id's returns null instead of throwing

This commit is contained in:
Ty Voliter 2012-06-13 18:19:03 -07:00
Родитель 3cb90ff986
Коммит f65b33e3ad
2 изменённых файлов: 4 добавлений и 8 удалений

Просмотреть файл

@ -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);