mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-18 16:12:11 +00:00
feat: separate notification subjects and recipients
This commit is contained in:
1 parent
6771b9060f
commit
6108a71d80
4 files changed
+131
-14
No files matched your search
@@ -5,12 +5,13 @@ import { recordPushAttempt } from "@/lib/notifications/senders/push-attempt-reco
|
||||
|
||||
let sequence = 0;
|
||||
|
||||
async function createUser(label: string) {
|
||||
async function createUser(label: string, managed = false) {
|
||||
const suffix = sequence++;
|
||||
return getPrismaClient().user.create({
|
||||
data: {
|
||||
username: `${label}-${suffix}`,
|
||||
email: `${label}-${suffix}@example.test`,
|
||||
managedProfileAt: managed ? new Date() : null,
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -21,7 +22,7 @@ beforeEach(async () => {
|
||||
|
||||
describe("notification attribution (real Postgres)", () => {
|
||||
it("persistence retains distinct record and recipient principals", async () => {
|
||||
const recordUser = await createUser("record");
|
||||
const recordUser = await createUser("record", true);
|
||||
const recipientUser = await createUser("recipient");
|
||||
|
||||
recordPushAttempt({
|
||||
|
||||
Reference in new issue
Block a user