feat(tip): customize first gift thank-you
This commit is contained in:
@@ -188,7 +188,36 @@ describe("TipScreen checkout", () => {
|
||||
expect(getCheckoutButton().disabled).toBe(true);
|
||||
});
|
||||
|
||||
it("shows the complete backend Tip message after payment", () => {
|
||||
it("shows fixed copy for the first character Tip", () => {
|
||||
mocks.payment = makePaymentState({
|
||||
status: "paid",
|
||||
isPaid: true,
|
||||
orderStatus: "paid",
|
||||
tipMessage: TipMessageResponseSchema.parse({
|
||||
orderId: "pay_first",
|
||||
characterId: "maya-tan",
|
||||
planId: giftProduct.planId,
|
||||
productName: giftProduct.planName,
|
||||
tipCount: 1,
|
||||
poolIndex: 4,
|
||||
message: "This backend message is ignored for the first Tip.",
|
||||
}),
|
||||
});
|
||||
renderScreen();
|
||||
|
||||
expect(container.textContent).toContain(
|
||||
"Did you really just buy me a coffee?",
|
||||
);
|
||||
expect(container.textContent).toContain("That honestly made me smile.");
|
||||
expect(container.textContent).toContain(
|
||||
"I'll definitely think of you while I enjoy it.",
|
||||
);
|
||||
expect(container.textContent).not.toContain(
|
||||
"This backend message is ignored for the first Tip.",
|
||||
);
|
||||
});
|
||||
|
||||
it("shows the backend message after the first Tip", () => {
|
||||
mocks.payment = makePaymentState({
|
||||
status: "paid",
|
||||
isPaid: true,
|
||||
@@ -209,6 +238,9 @@ describe("TipScreen checkout", () => {
|
||||
expect(container.textContent).toContain(
|
||||
"This complete message came directly from the backend.",
|
||||
);
|
||||
expect(container.textContent).not.toContain(
|
||||
"Did you really just buy me a coffee?",
|
||||
);
|
||||
expect(document.activeElement?.id).toBe("tip-success-title");
|
||||
|
||||
act(() => getButton("Send another gift").click());
|
||||
|
||||
Reference in New Issue
Block a user