Skip to content

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

1.1 KB
Raw Blame
import { describe, expect, it, vi } from "vitest";
import { render, screen } from "@testing-library/react";
import { MemoryRouter } from "react-router-dom";
const props = vi.hoisted(() => ({ seen: {} as Record<string, unknown> }));
vi.mock("@editor/portal/views/Usage", () => ({
  Usage: (value: Record<string, unknown>) => {
    props.seen = value;
    return <div data-testid="usage" />;
  },
}));
import { BillingSettingsSection } from "@editor/portal/components/settings/BillingSettingsSection";
import { useAccountLinkOwner } from "@editor/portal/hooks/useAccountLinkOwner";

describe("PortalBillingGate — SaaS", () => {
  it("renders hosted billing without any self-hosted renewal or connection actions", () => {
    render(
      <MemoryRouter initialEntries={["/settings/billing"]}>
        <BillingSettingsSection />
      </MemoryRouter>,
    );
    expect(screen.getByTestId("usage")).toBeInTheDocument();
    expect(props.seen.sessionRecovery).toBeUndefined();
    expect(props.seen.onReauth).toBeUndefined();
    expect(useAccountLinkOwner()).toBe(false);
  });
});