Skip to content

Commit

Permalink
Add failing tests for #221
Browse files Browse the repository at this point in the history
  • Loading branch information
perry-mitchell committed Oct 15, 2020
1 parent bd2e56e commit 519ead0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/specs/getDirectoryContents.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ describe("getDirectoryContents", function() {
});
});

it("returns correct names for directories that contain % in the name", function() {
return this.client.getDirectoryContents("/").then(function(contents) {
const noPercent = contents.find(item => item.basename === "two words");
const percent = contents.find(item => item.basename === "two%20words");
expect(noPercent).to.have.property("type", "directory");
expect(percent).to.have.property("type", "directory");
});
});

describe("when using details: true", function() {
it("returns data and headers properties", function() {
return this.client.getDirectoryContents("/", { details: true }).then(function(details) {
Expand Down
8 changes: 8 additions & 0 deletions test/specs/stat.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ describe("stat", function() {
});
});

it("sets names correctly when source contains '%' in the path (#221)", function() {
return this.client.stat("/two%20words").then(function(stat) {
expect(stat).to.be.an("object");
expect(stat).to.have.property("filename", "/two%20words");
expect(stat).to.have.property("basename", "two%20words");
});
});

describe("with details: true", function() {
it("returns data property", function() {
return this.client.stat("/", { details: true }).then(function(result) {
Expand Down

0 comments on commit 519ead0

Please sign in to comment.