Skip to content

Commit

Permalink
Update tests for path decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
perry-mitchell committed Apr 19, 2020
1 parent b693670 commit 7fef287
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions test/serverContents/file&name.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test
8 changes: 4 additions & 4 deletions test/specs/getDirectoryContents.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ describe("getDirectoryContents", function() {

it("returns correct file results", function() {
return this.client.getDirectoryContents("/").then(function(contents) {
const sub1 = contents.find(function(item) {
return item.basename === "alrighty.jpg";
});
const sub1 = contents.find(item =>item.basename === "alrighty.jpg");
const sub2 = contents.find(item => item.basename === "file&name.txt");
expect(sub1.filename).to.equal("/alrighty.jpg");
expect(sub1.size).to.equal(52130);
expect(sub1.type).to.equal("file");
expect(sub2.filename).to.equal("/file&name.txt");
});
});

Expand Down Expand Up @@ -101,7 +101,7 @@ describe("getDirectoryContents", function() {
});

it("returns correct directory contents when path contains encoded sequences (issue #93)", function() {
return this.client.getDirectoryContents("/two%20words").then(function(contents) {
return this.client.getDirectoryContents("/two%20words").then(contents => {
expect(contents).to.have.lengthOf(1);
expect(contents[0].basename).to.equal("file2.txt");
});
Expand Down

0 comments on commit 7fef287

Please sign in to comment.