Refuse a group change that would lock the acting admin out, and title a read-only user page View user
CI / full-gate (push) Successful in 3m22s

This commit is contained in:
2026-10-31 10:47:47 +01:00
parent fcc5e04e0d
commit ad812e17c2
9 changed files with 140 additions and 35 deletions
@@ -100,6 +100,12 @@ test("buildUserFormModel: edit mode prefills, locks email, and exposes state/del
assert.equal(buildUserFormModel({ identity: identity(4, { state: "inactive" }) }).edit!.nextLabel, "Reactivate");
});
test("buildUserFormModel: a users:read holder sees the page titled View user, with a View breadcrumb", () => {
const m = buildUserFormModel({ canWrite: false, identity: identity(3) });
assert.equal(m.title, "View user");
assert.deepEqual(m.breadcrumbs.at(-1), { label: "View" });
});
test("createIdentityPayload: schema/state/traits, name only when given, password only when set", () => {
assert.deepEqual(createIdentityPayload({ email: "a@b.c", first: "Ada", last: "Lovelace", password: "" }), {
schema_id: "default",