Files
font-tools/tests/components/Workbench.test.tsx
T
zemion 873cf3c04b
Verify / verify (push) Canceled after 0s
Release Font Tools 0.2.0
2026-09-02 12:18:37 +02:00

27 lines
907 B
TypeScript

import { render, screen } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
import { Workbench } from "../../src/components/Workbench";
vi.mock("../../src/core/fontClient", () => ({
FontWorkerClient: class FontWorkerClient {},
}));
describe("Font Workbench", () => {
it("presents an actionable local-only empty state", () => {
render(<Workbench />);
expect(
screen.getByRole("heading", { name: "Know what is inside a font." }),
).toBeVisible();
expect(screen.getByLabelText("Open font")).toHaveAttribute(
"accept",
expect.stringContaining(".woff2"),
);
expect(screen.getByLabelText("Open font")).toHaveAttribute(
"accept",
expect.stringContaining(".ttc"),
);
expect(screen.getByText(/Disposable worker/u)).toBeVisible();
expect(screen.getByRole("status")).toHaveTextContent("Choose a local");
});
});