refactor(chat): show images in page overlay

This commit is contained in:
2026-07-09 10:11:25 +08:00
parent cb7791dd8d
commit fc92c3a5d5
23 changed files with 253 additions and 627 deletions
@@ -39,12 +39,12 @@ describe("subscription exit helpers", () => {
consumePendingChatImageReturnMock.mockResolvedValue({
reason: "image_paywall",
messageId: "msg_1",
returnUrl: "/chat/image/msg_1",
returnUrl: "/chat?image=msg_1",
createdAt: 1,
});
await expect(consumeSubscriptionExplicitExitUrl()).resolves.toBe(
"/chat/image/msg_1",
"/chat?image=msg_1",
);
});
@@ -70,13 +70,13 @@ describe("subscription exit helpers", () => {
reason: "single_message_unlock",
messageId: "msg_1",
kind: "image",
returnUrl: "/chat/image/msg_1",
returnUrl: "/chat?image=msg_1",
stage: "payment",
createdAt: 1,
});
await expect(peekSubscriptionExplicitExitUrl()).resolves.toBe(
"/chat/image/msg_1",
"/chat?image=msg_1",
);
expect(clearPendingChatUnlockMock).not.toHaveBeenCalled();
});
@@ -87,13 +87,13 @@ describe("subscription exit helpers", () => {
reason: "single_message_unlock",
messageId: "msg_1",
kind: "image",
returnUrl: "/chat/image/msg_1",
returnUrl: "/chat?image=msg_1",
stage: "payment",
createdAt: 1,
});
await expect(consumeSubscriptionExplicitExitUrl()).resolves.toBe(
"/chat/image/msg_1",
"/chat?image=msg_1",
);
expect(clearPendingChatUnlockMock).toHaveBeenCalledTimes(1);
});