31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
import { render, screen } from "@testing-library/react";
|
|
import userEvent from "@testing-library/user-event";
|
|
import { describe, expect, it, vi } from "vitest";
|
|
import { App } from "../../src/App";
|
|
|
|
describe("Schema Tools", () => {
|
|
it("renders capability tiers and validates the bundled local workspace", async () => {
|
|
vi.stubGlobal(
|
|
"fetch",
|
|
vi.fn(async () => new Response("Not found", { status: 404 })),
|
|
);
|
|
render(<App />);
|
|
expect(
|
|
await screen.findByRole("heading", { name: "Schema Tools" }),
|
|
).toBeVisible();
|
|
await screen.findByText(
|
|
"Five languages, deliberately different guarantees",
|
|
undefined,
|
|
{ timeout: 15_000 },
|
|
);
|
|
expect(screen.getByText("focused validation")).toBeVisible();
|
|
expect(screen.getAllByText("structural only")).toHaveLength(2);
|
|
await userEvent.click(screen.getByRole("button", { name: "Validate" }));
|
|
await userEvent.click(
|
|
screen.getByRole("button", { name: "Validate instance" }),
|
|
);
|
|
expect(screen.getByText(/Instance is valid/u)).toBeVisible();
|
|
expect(screen.getByText("Browser-local")).toBeVisible();
|
|
}, 20_000);
|
|
});
|