Files
sase.tr/apps/web/src/routes/__tests__/pricing-faq.test.tsx
Semih Yesilyurt b8c2e7568a feat(web): add FAQ section to pricing page
The pricing page had no objection handling and a half-empty page below the
cards. Added a PricingFaq disclosure section (native <details>) covering the
six recurring questions: how the free trial works, whether a card is needed,
cancellation, refunds, changing plan/brands, and payment security — all
grounded in actual product behaviour (30-day Full trial, no card, period-end
access on cancel, downgrade, Stripe PCI-DSS / KVKK).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 16:15:03 +03:00

37 lines
1.1 KiB
TypeScript

/**
* Tests the pricing FAQ — the objection-handling section that fills the
* previously-empty space below the cards (trial, credit card, cancel,
* refund, plan/brand change, payment security).
*/
import { render } from "@testing-library/react";
import { vi } from "vitest";
vi.mock("@/lib/i18n", () => ({
useTranslation: () => ({
t: (key: string) => key,
locale: "tr",
setLocale: vi.fn(),
}),
}));
import { PricingFaq } from "@/routes/pricing";
describe("PricingFaq", () => {
test("renders the title and all six question/answer pairs", () => {
const { container } = render(<PricingFaq />);
const text = container.textContent ?? "";
expect(text).toContain("pricing.faq.title");
for (let i = 1; i <= 6; i++) {
expect(text).toContain(`pricing.faq.q${i}`);
expect(text).toContain(`pricing.faq.a${i}`);
}
});
test("uses native <details> disclosures (one per question)", () => {
const { container } = render(<PricingFaq />);
expect(container.querySelectorAll("details")).toHaveLength(6);
expect(container.querySelectorAll("summary")).toHaveLength(6);
});
});