feat: manage owner usage history records
This commit is contained in:
@@ -160,3 +160,19 @@ test("usage creation sends only the supplied API contract", async () => {
|
||||
assert.equal("use" in JSON.parse(captured.options.body), false);
|
||||
assert.equal("balance" in JSON.parse(captured.options.body), false);
|
||||
});
|
||||
|
||||
test("usage deletion uses the record route and DELETE method", async () => {
|
||||
let captured;
|
||||
const api = loadClient({
|
||||
search: "?mode=api",
|
||||
fetchImpl: async (url, options) => {
|
||||
captured = { url, options };
|
||||
return jsonResponse(null, 204);
|
||||
}
|
||||
});
|
||||
await api.client.deleteUsageRecord("00000000-0000-4000-8000-000000000002");
|
||||
assert.equal(captured.url.pathname, "/usage-records/00000000-0000-4000-8000-000000000002");
|
||||
assert.equal(captured.options.method, "DELETE");
|
||||
assert.equal(captured.options.credentials, "include");
|
||||
assert.equal(captured.options.body, undefined);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user