blob: 22a0aec2efbfd61e6a7d5a542e966e37eb562fe3 (
plain)
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
|
/**
* @vitest-environment jsdom
*/
import { cleanup, render, screen } from "@testing-library/react";
import { afterEach, describe, expect, test } from "vitest";
import BorderedContainer from "./BorderedContainer";
afterEach(() => {
cleanup();
});
describe("BorderedContainer", () => {
test("renders children", () => {
render(<BorderedContainer>Hello World</BorderedContainer>);
expect(screen.getByText("Hello World")).toBeDefined();
});
test("applies custom className", () => {
render(
<BorderedContainer className="custom-class">Content</BorderedContainer>,
);
const container = screen.getByText("Content").closest("div");
expect(container?.className).toContain("custom-class");
});
test("has default border styling", () => {
render(<BorderedContainer>Styled</BorderedContainer>);
const container = screen.getByText("Styled").closest("div");
expect(container?.className).toContain("border-2");
expect(container?.className).toContain("border-brand-600");
expect(container?.className).toContain("rounded-xl");
});
});
|