Initial Commit

This commit is contained in:
Draculabo committed 2025-12-23 01:38:53 +08:00
commit d0417339c1
158 files changed
+31368

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
// @vitest-environment happy-dom
import { render } from "@testing-library/react";
import { test, expect } from "vitest";
import ToggleTheme from "@/components/toggle-theme";
test("renders ToggleTheme", () => {
const { getByRole } = render(<ToggleTheme />);
const isButton = getByRole("button");
expect(isButton).toBeInTheDocument();
});
test("has icon", () => {
const { getByRole } = render(<ToggleTheme />);
const button = getByRole("button");
const icon = button.querySelector("svg");
expect(icon).toBeInTheDocument();
});
test("is moon icon", () => {
const svgIconClassName: string = "lucide-moon";
const { getByRole } = render(<ToggleTheme />);
const svg = getByRole("button").querySelector("svg");
expect(svg?.classList).toContain(svgIconClassName);
});