Adding test with invalid role IDs.#

This commit is contained in:
mike12345567 2024-10-22 16:06:26 +01:00
parent 99d867fe60
commit f91e039402
1 changed files with 10 additions and 0 deletions

View File

@ -39,6 +39,16 @@ describe("/roles", () => {
})
})
it("handle a role with invalid inherits", async () => {
const role = basicRole()
role.inherits = ["not_real", "some_other_not_real"]
const res = await config.api.roles.save(role, {
status: 200,
})
expect(res.inherits).toEqual([BUILTIN_ROLE_IDS.BASIC])
})
it("handle a role with no inherits", async () => {
const role = basicRole()
role.inherits = []