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

Commit 4152415

Browse files
committed
Merge pull request #1939 from zanqi/renaming
Unit test for renaming
2 parents 444bd1f + cff3e2b commit 4152415

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

test/spec/WorkingSetView-test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,24 @@ define(function (require, exports, module) {
227227
expect(listItems.find(".file-status-icon dirty").length).toBe(0);
228228
});
229229
});
230+
231+
it("should show the file in project tree when a file is being renamed", function () {
232+
runs(function () {
233+
var $ = testWindow.$;
234+
var secondItem = $("#open-files-container > ul").children().eq(1);
235+
var fileName = secondItem.text();
236+
secondItem.trigger('click');
237+
238+
// Calling FILE_RENAME synchronously works fine here since the item is already visible in project file tree.
239+
// However, if the selected item is not already visible in the tree, this command will complete asynchronously.
240+
// In that case, waitsFor will be needed before continuing with the rest of the test.
241+
CommandManager.execute(Commands.FILE_RENAME);
242+
243+
var $projectFileItems = $("#project-files-container > ul").children();
244+
245+
expect($projectFileItems.find("a.jstree-clicked").eq(0).siblings("input").eq(0).val()).toBe(fileName);
246+
});
247+
});
230248

231249
});
232250
});

0 commit comments

Comments
 (0)