style: add eslint and prettier, fix style errors
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script>
|
||||
import Layout from "$routes/+layout.svelte";
|
||||
</script>
|
||||
|
||||
<Layout>
|
||||
<span data-testid="test-child">Hello</span>
|
||||
</Layout>
|
||||
<script>
|
||||
import Layout from "$routes/+layout.svelte";
|
||||
</script>
|
||||
|
||||
<Layout>
|
||||
<span data-testid="test-child">Hello</span>
|
||||
</Layout>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script>
|
||||
import Page from "$routes/+page.svelte";
|
||||
</script>
|
||||
|
||||
<Page />
|
||||
<script>
|
||||
import Page from "$routes/+page.svelte";
|
||||
</script>
|
||||
|
||||
<Page />
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { prerender, ssr } from "$routes/+layout";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
describe("+layout.ts", () => {
|
||||
it("should export ssr as false", () => {
|
||||
expect(ssr).toBe(false);
|
||||
});
|
||||
|
||||
it("should export prerender as true", () => {
|
||||
expect(prerender).toBe(true);
|
||||
});
|
||||
});
|
||||
import { prerender, ssr } from "$routes/+layout";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
describe("+layout.ts", () => {
|
||||
it("should export ssr as false", () => {
|
||||
expect(ssr).toBe(false);
|
||||
});
|
||||
|
||||
it("should export prerender as true", () => {
|
||||
expect(prerender).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { render, screen } from "@testing-library/svelte";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import PageTest from "./PageTest.svelte";
|
||||
|
||||
describe("+page.svelte", () => {
|
||||
it("should render without crashing", () => {
|
||||
render(PageTest);
|
||||
expect(screen.getByText("Тексты панелей")).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
import { render, screen } from "@testing-library/svelte";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import PageTest from "./PageTest.svelte";
|
||||
|
||||
describe("+page.svelte", () => {
|
||||
it("should render without crashing", () => {
|
||||
render(PageTest);
|
||||
expect(screen.getByText("Тексты панелей")).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user