feat(tip): refine single-screen payment layout

This commit is contained in:
2026-07-21 15:15:50 +08:00
parent fa08cc114f
commit 612c4139af
5 changed files with 509 additions and 436 deletions
@@ -62,6 +62,28 @@ describe("PaymentMethodSelector", () => {
);
});
it("renders compact controls without the caption", () => {
const html = renderToStaticMarkup(
<PaymentMethodSelector
config={{
canChoosePaymentMethod: true,
initialPayChannel: "ezpay",
showPaymentMethodSelector: true,
}}
value="ezpay"
density="compact"
caption="This caption is hidden"
analyticsKey="tip.payment_method"
onChange={() => undefined}
/>,
);
expect(html).toContain('data-density="compact"');
expect(html).toContain("Payment Method");
expect(html).not.toContain("This caption is hidden");
expect(html).toContain("min-h-11");
});
it("does not render when payment method selection is unavailable", () => {
const html = renderToStaticMarkup(
<PaymentMethodSelector