Skip to content

Commit

Permalink
Test that NOT_FOUND error is thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaSBrown committed Jan 17, 2025
1 parent f51b41f commit cdb0dca
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/database/foxx/tests/authz.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe("Authz functions", () => {
});

describe("unit_authz: if a record is part of George's user allocation a non owning regular user 'bob' should not have access to the record", () => {
it("unit_authz: should thrown an error if bob tries to run a create request on the record.", () => {
it("unit_authz: should throw an error if bob tries to run a create request on the record.", () => {
let data_key = "data_key";
let data_id = "d/" + data_key;

Expand All @@ -78,7 +78,10 @@ describe("Authz functions", () => {

expect(() =>
authzModule.isRecordActionAuthorized(client, data_key, req_perm),
).to.throw();
).to.throw().and.satisfy((error) => {
return Array.isArray(error) &&
error[0] === g_lib.ERR_NOT_FOUND;
});
});
});

Expand Down

0 comments on commit cdb0dca

Please sign in to comment.