mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 13:01:00 +00:00
test(02-12): cover defensive record presentation
- reject inconsistent access levels before chrome can elevate them\n- fall back to the caller record for malformed payloads
This commit is contained in:
1 parent
b53147559a
commit
a33cde3034
1 file changed
+18
@@ -114,4 +114,22 @@ describe("shared-record navigation", () => {
|
||||
}),
|
||||
).toEqual({ access: "manage", recordKind: "managed" });
|
||||
});
|
||||
|
||||
it("fails closed when a malformed entry reaches presentation", () => {
|
||||
expect(
|
||||
resolveRecordPresentation({
|
||||
level: "manage",
|
||||
canWrite: false,
|
||||
recordKind: "managed",
|
||||
} as never),
|
||||
).toEqual({ access: "view", recordKind: "self" });
|
||||
|
||||
expect(
|
||||
resolveRecordPresentation({
|
||||
level: "unknown",
|
||||
canWrite: true,
|
||||
recordKind: "shared",
|
||||
} as never),
|
||||
).toEqual({ access: "view", recordKind: "self" });
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user