feat(chat): tailor insufficient credits guidance
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { getInsufficientCreditsMessageLimitView } from "../chat-screen.helpers";
|
||||
|
||||
describe("getInsufficientCreditsMessageLimitView", () => {
|
||||
it("asks guests to log in for more free chats", () => {
|
||||
expect(getInsufficientCreditsMessageLimitView("guest")).toEqual({
|
||||
title: "Log in to get more free chats",
|
||||
description: "Free chats refresh every day. Log in to get more chances.",
|
||||
ctaLabel: "Log in to continue",
|
||||
action: "auth",
|
||||
});
|
||||
});
|
||||
|
||||
it("treats the transient not logged in state like guest", () => {
|
||||
expect(getInsufficientCreditsMessageLimitView("notLoggedIn")).toEqual({
|
||||
title: "Log in to get more free chats",
|
||||
description: "Free chats refresh every day. Log in to get more chances.",
|
||||
ctaLabel: "Log in to continue",
|
||||
action: "auth",
|
||||
});
|
||||
});
|
||||
|
||||
it.each(["email", "facebook", "google", "apple"] as const)(
|
||||
"asks %s users to top up credits",
|
||||
(loginStatus) => {
|
||||
expect(getInsufficientCreditsMessageLimitView(loginStatus)).toEqual({
|
||||
title: "Insufficient credits\nTop up to continue chatting",
|
||||
description: "Free chats refresh every day. You can also top up credits now.",
|
||||
ctaLabel: "Top up credits to continue",
|
||||
action: "topup",
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user