mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 04:50:59 +00:00
test: update notification sender attempt mocks
- Exercise identity-aware delivery attempt recording\n- Keep self-delivery assertions explicit
This commit is contained in:
1 parent
d9b675f993
commit
2ccd022410
7 files changed
+20
-1
No files matched your search
@@ -137,7 +137,8 @@ describe("dispatchNotification — client-managed APNs suppression", () => {
|
||||
},
|
||||
);
|
||||
expect(recordPushAttemptMock).toHaveBeenCalledWith({
|
||||
userId: "u-1",
|
||||
recordUserId: "u-1",
|
||||
recipientUserId: "u-1",
|
||||
channel: "APNS",
|
||||
eventType: "MEDICATION_REMINDER",
|
||||
result: "skipped",
|
||||
|
||||
@@ -45,6 +45,7 @@ vi.mock("@/lib/logging/context", () => ({
|
||||
|
||||
vi.mock("@/lib/notifications/senders/push-attempt-record", () => ({
|
||||
recordPushAttempt: vi.fn(),
|
||||
recordPushAttemptForPayload: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("@/lib/db", () => ({
|
||||
|
||||
@@ -38,6 +38,7 @@ vi.mock("@/lib/logging/context", () => ({
|
||||
|
||||
vi.mock("@/lib/notifications/senders/push-attempt-record", () => ({
|
||||
recordPushAttempt: vi.fn(),
|
||||
recordPushAttemptForPayload: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("@/lib/db", () => ({
|
||||
|
||||
@@ -31,6 +31,11 @@ vi.mock("@/lib/logging/context", () => ({
|
||||
|
||||
vi.mock("@/lib/notifications/senders/push-attempt-record", () => ({
|
||||
recordPushAttempt: (...args: unknown[]) => recordPushAttemptMock(...args),
|
||||
recordPushAttemptForPayload: (
|
||||
_payload: unknown,
|
||||
_recipientUserId: string,
|
||||
attempt: unknown,
|
||||
) => recordPushAttemptMock(attempt),
|
||||
}));
|
||||
|
||||
import { sendViaEmail, resetEmailTransporterForTesting } from "../email";
|
||||
|
||||
@@ -42,6 +42,7 @@ vi.mock("@/lib/logging/context", () => ({
|
||||
|
||||
vi.mock("@/lib/notifications/senders/push-attempt-record", () => ({
|
||||
recordPushAttempt: vi.fn(),
|
||||
recordPushAttemptForPayload: vi.fn(),
|
||||
}));
|
||||
|
||||
const scheduleTelegramAutoDeleteMock = vi.fn();
|
||||
|
||||
@@ -35,6 +35,11 @@ vi.mock("@/lib/logging/context", () => ({
|
||||
|
||||
vi.mock("@/lib/notifications/senders/push-attempt-record", () => ({
|
||||
recordPushAttempt: (...args: unknown[]) => recordPushAttemptMock(...args),
|
||||
recordPushAttemptForPayload: (
|
||||
_payload: unknown,
|
||||
_recipientUserId: string,
|
||||
attempt: unknown,
|
||||
) => recordPushAttemptMock(attempt),
|
||||
}));
|
||||
|
||||
vi.mock("@/lib/db", () => ({
|
||||
|
||||
@@ -27,6 +27,11 @@ vi.mock("@/lib/logging/context", () => ({
|
||||
|
||||
vi.mock("@/lib/notifications/senders/push-attempt-record", () => ({
|
||||
recordPushAttempt: (...args: unknown[]) => recordPushAttemptMock(...args),
|
||||
recordPushAttemptForPayload: (
|
||||
_payload: unknown,
|
||||
_recipientUserId: string,
|
||||
attempt: unknown,
|
||||
) => recordPushAttemptMock(attempt),
|
||||
}));
|
||||
|
||||
import { sendViaWebhook } from "../webhook";
|
||||
|
||||
Reference in new issue
Block a user