Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling FILE_RENAME synchronously works fine here since the item is already visible in the tree. However, if the selected item was not already visible in the tree, this command would complete asynchronously, and you would need to wait before continuing on with the tests. It would be nice to add a comment explaining this just in case this test gets copied/pasted into a new test.


var $projectFileItems = $("#project-files-container > ul").children();

expect($projectFileItems.find("a.jstree-clicked").eq(0).siblings("input").eq(0).val()).toBe(fileName);
});
});

});
});