File size: 1,163 Bytes
900a32d e4daa3b 900a32d e4daa3b 900a32d e4daa3b 900a32d e4daa3b 900a32d e4daa3b 900a32d e4daa3b 900a32d e4daa3b 900a32d e4daa3b 900a32d e4daa3b 900a32d e4daa3b 900a32d e4daa3b 900a32d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
import { describe, it, expect } from "vitest";
import { render, screen } from "@testing-library/react";
import { Layout } from "../Layout";
describe("Layout", () => {
it("renders header with title", () => {
render(<Layout>Content</Layout>);
expect(
screen.getByRole("heading", { name: /stroke lesion segmentation/i }),
).toBeInTheDocument();
});
it("renders subtitle", () => {
render(<Layout>Content</Layout>);
expect(screen.getByText(/deepisles segmentation/i)).toBeInTheDocument();
});
it("renders children in main area", () => {
render(
<Layout>
<div data-testid="child">Test Child</div>
</Layout>,
);
expect(screen.getByTestId("child")).toBeInTheDocument();
});
it("has accessible landmark structure", () => {
render(<Layout>Content</Layout>);
expect(screen.getByRole("banner")).toBeInTheDocument();
expect(screen.getByRole("main")).toBeInTheDocument();
});
it("applies dark theme styling", () => {
render(<Layout>Content</Layout>);
const container = screen.getByRole("banner").parentElement;
expect(container).toHaveClass("bg-gray-950");
});
});
|