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
31 changes: 31 additions & 0 deletions test/spec/ProjectManager-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,37 @@ describe("ProjectManager", function() {
expect(didCreate).toBeFalsy();
});
});

it("should fail when file name contains special characters", function() {
var chars = "/?*:;{}<>\\";
var i = 0;
var len = chars.length;
var charAt, didCreate, gotError;

runs(function() {
this.app.ProjectManager.loadProject(this.testPath);
});
waitsFor(function() { return this.app.ProjectManager.getProjectRoot() }, "loadProject() timeout", 1000);

for (i = 0; i < len; i++) {
didCreate = false;
gotError = false;
charAt = chars.charAt(i);

runs(function() {
// skip rename
this.app.ProjectManager.createNewItem(this.testPath, "file" + charAt + ".js", true)
.done(function() { didCreate = true; })
.fail(function() { gotError = true; });
});
waitsFor(function() { return !didCreate && gotError; }, "ProjectManager.createNewItem() timeout", 1000);

runs(function() {
expect(gotError).toBeTruthy();
expect(didCreate).toBeFalsy();
});
}
});
});

});