fix(chat): use weekly limit for message quota

This commit is contained in:
2026-06-29 18:40:44 +08:00
parent a821d01834
commit cee63e8658
8 changed files with 20 additions and 20 deletions
@@ -437,7 +437,7 @@ describe("chatMachine transitions", () => {
actor.stop();
});
it("clears the daily limit prompt after payment succeeds", async () => {
it("clears the weekly limit prompt after payment succeeds", async () => {
const actor = createActor(createTestChatMachine()).start();
actor.send({ type: "ChatUserLogin", token: "token" });
@@ -459,11 +459,11 @@ describe("chatMachine transitions", () => {
locked: true,
showContent: false,
showUpgrade: true,
reason: "daily_limit",
reason: "weekly_limit",
hint: "Free message limit reached.",
detail: {
type: "daily_msg_limit",
usedToday: 3,
type: "weekly_msg_limit",
usedThisWeek: 3,
limit: 3,
},
},
@@ -473,7 +473,7 @@ describe("chatMachine transitions", () => {
});
expect(actor.getSnapshot().context.upgradePromptVisible).toBe(true);
expect(actor.getSnapshot().context.upgradeReason).toBe("daily_limit");
expect(actor.getSnapshot().context.upgradeReason).toBe("weekly_limit");
actor.send({ type: "ChatPaymentSucceeded" });