Decorative images on the marketing pages stay quiet, and every dialog close button is named Close. Co-authored-by: Cursor <cursoragent@cursor.com>
23 lines
936 B
TypeScript
23 lines
936 B
TypeScript
import { render } from "@testing-library/react";
|
|
import { describe, it, expect } from "vitest";
|
|
import "@testing-library/jest-dom/vitest";
|
|
import SectionNumber from "../../app/components/sections/SectionNumber";
|
|
|
|
describe("SectionNumber", () => {
|
|
it("rotates the shape and keeps the numeral upright", () => {
|
|
const { container } = render(<SectionNumber number={1} />);
|
|
|
|
const numeral = container.querySelector("span");
|
|
expect(numeral).toHaveTextContent("1");
|
|
expect(numeral).toHaveClass("text-large-label");
|
|
expect(numeral?.className).not.toMatch(/rotate/);
|
|
|
|
const shape = container.querySelector("img");
|
|
expect(shape).toHaveAttribute("alt", "");
|
|
expect(shape).toHaveClass("rotate-15");
|
|
expect(shape?.parentElement).toHaveAttribute("aria-hidden", "true");
|
|
expect(shape?.parentElement).not.toHaveClass("rotate-15");
|
|
expect(shape?.parentElement?.className).not.toMatch(/-rotate-/);
|
|
});
|
|
});
|