fix(chat): unify insufficient credits prompt
This commit is contained in:
@@ -11,35 +11,13 @@ afterEach(() => {
|
||||
});
|
||||
|
||||
describe("getInsufficientCreditsMessageLimitView", () => {
|
||||
it("asks guests to log in for more free chats", () => {
|
||||
expect(getInsufficientCreditsMessageLimitView("guest")).toEqual({
|
||||
title: "Log in to get more free chats",
|
||||
it("shows the same top-up prompt without checking login status", () => {
|
||||
expect(getInsufficientCreditsMessageLimitView()).toEqual({
|
||||
title: "Insufficient credits",
|
||||
description: "Free chats refresh every day.",
|
||||
ctaLabel: "Log in to continue",
|
||||
action: "auth",
|
||||
ctaLabel: "Top up credits to continue",
|
||||
});
|
||||
});
|
||||
|
||||
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.",
|
||||
ctaLabel: "Log in to continue",
|
||||
action: "auth",
|
||||
});
|
||||
});
|
||||
|
||||
it.each(["email", "facebook", "google"] as const)(
|
||||
"asks %s users to top up credits",
|
||||
(loginStatus) => {
|
||||
expect(getInsufficientCreditsMessageLimitView(loginStatus)).toEqual({
|
||||
title: "Insufficient credits",
|
||||
description: "Free chats refresh every day.",
|
||||
ctaLabel: "Top up credits to continue",
|
||||
action: "topup",
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
describe("shouldShowMessageLimitBanner", () => {
|
||||
|
||||
Reference in New Issue
Block a user