Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1939 from zanqi/renaming
Browse files Browse the repository at this point in the history
Unit test for renaming
  • Loading branch information
gruehle committed Oct 26, 2012
2 parents 444bd1f + cff3e2b commit 4152415
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/spec/WorkingSetView-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

});
});

0 comments on commit 4152415

Please sign in to comment.