Merge pull request #1939 from zanqi/renaming

Unit test for renaming
This commit is contained in:
Glenn Ruehle 2012-10-26 08:44:47 -07:00
Родитель 444bd1f367 cff3e2bd78
Коммит 4152415609
1 изменённых файлов: 18 добавлений и 0 удалений

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

@ -227,6 +227,24 @@ define(function (require, exports, module) {
expect(listItems.find(".file-status-icon dirty").length).toBe(0);
});
});
it("should show the file in project tree when a file is being renamed", function () {
runs(function () {
var $ = testWindow.$;
var secondItem = $("#open-files-container > ul").children().eq(1);
var fileName = secondItem.text();
secondItem.trigger('click');
// Calling FILE_RENAME synchronously works fine here since the item is already visible in project file tree.
// However, if the selected item is not already visible in the tree, this command will complete asynchronously.
// In that case, waitsFor will be needed before continuing with the rest of the test.
CommandManager.execute(Commands.FILE_RENAME);
var $projectFileItems = $("#project-files-container > ul").children();
expect($projectFileItems.find("a.jstree-clicked").eq(0).siblings("input").eq(0).val()).toBe(fileName);
});
});
});
});