test: refactor tests, format files

This commit is contained in:
2026-02-08 20:45:16 +05:00
parent e838916d91
commit 59745eac4f
35 changed files with 46 additions and 119 deletions
@@ -1,15 +1,13 @@
import { render, screen, fireEvent } from "@testing-library/svelte";
import { describe, expect, it, beforeEach } from "vitest";
import { themeState } from "$states/theme.svelte";
import AppHeader from "$components/layout/AppHeader.svelte";
import { themeState } from "$states/theme.svelte";
import { fireEvent, render } from "@testing-library/svelte";
import { beforeEach, describe, expect, it } from "vitest";
describe("AppHeader.svelte", () => {
beforeEach(() => {
themeState.theme = "dark";
});
it("should toggle theme on button click", async () => {
const { container } = render(AppHeader);
@@ -23,6 +21,4 @@ describe("AppHeader.svelte", () => {
await fireEvent.click(toggleButton);
expect(themeState.theme).toBe("dark");
});
});
+1 -1
View File
@@ -1,4 +1,4 @@
import { render, screen } from "@testing-library/svelte";
import { render } from "@testing-library/svelte";
import { describe, expect, it } from "vitest";
import CardTest from "./CardTest.svelte";
@@ -1,4 +1,3 @@
<!-- CardTest.svelte -->
<script>
import Card from "$components/layout/Card.svelte";
</script>
@@ -1,4 +1,4 @@
import { render, screen } from "@testing-library/svelte";
import { render } from "@testing-library/svelte";
import { describe, expect, it } from "vitest";
import InputGroupTest from "./InputGroupTest.svelte";
@@ -1,4 +1,3 @@
<!-- InputGroupTest.svelte -->
<script>
import InputGroup from "$components/layout/InputGroup.svelte";
</script>
@@ -7,6 +7,4 @@ describe("PanelBar.svelte", () => {
const { container } = render(PanelBar);
expect(container).toBeInTheDocument();
});
});
@@ -1,4 +1,4 @@
import { render, screen } from "@testing-library/svelte";
import { render } from "@testing-library/svelte";
import { describe, expect, it } from "vitest";
import SettingsGridTest from "./SettingsGridTest.svelte";
@@ -1,4 +1,3 @@
<!-- SettingsGridTest.svelte -->
<script>
import SettingsGrid from "$components/layout/SettingsGrid.svelte";
</script>
@@ -1,4 +1,4 @@
import { render, screen } from "@testing-library/svelte";
import { render } from "@testing-library/svelte";
import { describe, expect, it } from "vitest";
import SettingsRowTest from "./SettingsRowTest.svelte";
@@ -1,4 +1,3 @@
<!-- SettingsRowTest.svelte -->
<script>
import SettingsRow from "$components/layout/SettingsRow.svelte";
</script>
@@ -7,6 +7,4 @@ describe("TextBar.svelte", () => {
const { container } = render(TextBar);
expect(container).toBeInTheDocument();
});
});