Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

735 B
Raw Blame
import { cleanup, fireEvent, render, screen } from "@testing-library/react";
import { afterEach, expect, it, vi } from "vite-plus/test";
import { CheckoutSuccessCallout } from "./checkout-success-callout";

vi.mock("react-i18next", () => ({
  useTranslation: () => ({ t: (key: string) => key }),
}));

afterEach(cleanup);

it("thanks the subscriber and can be dismissed", () => {
  const onDismiss = vi.fn();
  render(<CheckoutSuccessCallout onDismiss={onDismiss} />);

  expect(
    screen
      .getByRole("status")
      .textContent?.includes("settings:billing.checkoutSuccess.title"),
  ).toBe(true);
  fireEvent.click(screen.getByRole("button", { name: "common:actions.close" }));
  expect(onDismiss).toHaveBeenCalledOnce();
});