mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 06:06:10 +00:00
- Remove record-mutating affordances from Guardian channel payloads\n- Reject managed Telegram callbacks and verify channel attribution
22 lines
587 B
TypeScript
22 lines
587 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { isManagedGuardianDelivery } from "@/lib/notifications/managed-delivery";
|
|
|
|
describe("managed Guardian notification payload safety", () => {
|
|
it("recognises only cross-account record delivery as managed Guardian delivery", () => {
|
|
expect(
|
|
isManagedGuardianDelivery({
|
|
recordUserId: "record-1",
|
|
recipientUserId: "guardian-1",
|
|
}),
|
|
).toBe(true);
|
|
|
|
expect(
|
|
isManagedGuardianDelivery({
|
|
recordUserId: "user-1",
|
|
recipientUserId: "user-1",
|
|
}),
|
|
).toBe(false);
|
|
});
|
|
});
|