style: add eslint and prettier, fix style errors
This commit is contained in:
@@ -1,39 +1,39 @@
|
||||
import { themeState } from "$states/theme.svelte";
|
||||
import { render, screen } from "@testing-library/svelte";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import LayoutTest from "./LayoutTest.svelte";
|
||||
|
||||
describe("+layout.svelte", () => {
|
||||
beforeEach(() => {
|
||||
themeState.current = "dark";
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
it("should apply dark theme", () => {
|
||||
themeState.current = "dark";
|
||||
|
||||
expect(themeState.current).toBe("dark");
|
||||
});
|
||||
|
||||
it("should apply light theme", () => {
|
||||
themeState.current = "light";
|
||||
|
||||
expect(themeState.current).toBe("light");
|
||||
});
|
||||
|
||||
it("should toggle theme", () => {
|
||||
themeState.current = "dark";
|
||||
themeState.toggle();
|
||||
|
||||
expect(themeState.current).toBe("light");
|
||||
});
|
||||
});
|
||||
|
||||
describe("Layout Component Coverage", () => {
|
||||
it("should render children snippet and initialize props", () => {
|
||||
render(LayoutTest);
|
||||
|
||||
expect(screen.getByTestId("test-child")).toBeInTheDocument();
|
||||
expect(screen.getByRole("banner")).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
import { themeState } from "$states/theme.svelte";
|
||||
import { render, screen } from "@testing-library/svelte";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import LayoutTest from "./LayoutTest.svelte";
|
||||
|
||||
describe("+layout.svelte", () => {
|
||||
beforeEach(() => {
|
||||
themeState.current = "dark";
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
it("should apply dark theme", () => {
|
||||
themeState.current = "dark";
|
||||
|
||||
expect(themeState.current).toBe("dark");
|
||||
});
|
||||
|
||||
it("should apply light theme", () => {
|
||||
themeState.current = "light";
|
||||
|
||||
expect(themeState.current).toBe("light");
|
||||
});
|
||||
|
||||
it("should toggle theme", () => {
|
||||
themeState.current = "dark";
|
||||
themeState.toggle();
|
||||
|
||||
expect(themeState.current).toBe("light");
|
||||
});
|
||||
});
|
||||
|
||||
describe("Layout Component Coverage", () => {
|
||||
it("should render children snippet and initialize props", () => {
|
||||
render(LayoutTest);
|
||||
|
||||
expect(screen.getByTestId("test-child")).toBeInTheDocument();
|
||||
expect(screen.getByRole("banner")).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user