Skip to content

Commit

Permalink
Add test for getQuotaOptions path
Browse files Browse the repository at this point in the history
  • Loading branch information
n-peugnet committed Mar 2, 2022
1 parent 640afba commit bf54fb9
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/node/operations/getQuota.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ const {
SERVER_PASSWORD,
SERVER_PORT,
SERVER_USERNAME,
clean,
createWebDAVClient,
createWebDAVServer,
restoreRequests,
returnFakeResponse
returnFakeResponse,
useRequestSpy
} = require("../../helpers.node.js");

function useInvalidQuota() {
Expand All @@ -28,10 +31,15 @@ describe("getQuota", function() {
username: SERVER_USERNAME,
password: SERVER_PASSWORD
});
clean();
this.server = createWebDAVServer();
this.requestSpy = useRequestSpy();
return this.server.start();
});

afterEach(function() {
restoreRequests();
return this.server.stop();
});

it("returns correct available amount", function() {
Expand Down Expand Up @@ -68,4 +76,12 @@ describe("getQuota", function() {
.that.is.an("object");
});
});

it("supports path option", async function() {
await this.client.getQuota({ path: "sub1" });
const [requestOptions] = this.requestSpy.firstCall.args;
expect(requestOptions)
.to.have.property("url")
.that.matches(/webdav\/server\/sub1$/);
});
});

0 comments on commit bf54fb9

Please sign in to comment.