chore: update eslint config, update tests, constants

This commit is contained in:
2026-02-17 17:40:38 +05:00
parent c6d16ca9c2
commit 185e80ae0e
21 changed files with 224 additions and 112 deletions
@@ -1,9 +1,11 @@
import ImageManager from "$components/image/ImageManager.svelte";
import { render } from "@testing-library/svelte";
import { describe, it } from "vitest";
import { describe, expect, it } from "vitest";
describe("ImageManager.svelte", () => {
it("should render without crashing", () => {
render(ImageManager);
const { container } = render(ImageManager);
expect(container).toBeTruthy();
});
});
+4 -4
View File
@@ -2,11 +2,11 @@ import Preview from "$components/panel/Preview.svelte";
import { cleanup, render } from "@testing-library/svelte";
import { afterEach, describe, expect, it } from "vitest";
afterEach(() => {
cleanup();
});
describe("Preview.svelte", () => {
afterEach(() => {
cleanup();
});
it("should render without crashing", () => {
const { container } = render(Preview, {
props: {
@@ -1,14 +1,11 @@
import PreviewAll from "$components/panel/PreviewAll.svelte";
import { textsState } from "$states/texts.svelte";
import { render } from "@testing-library/svelte";
import { beforeEach, describe, it } from "vitest";
import { describe, expect, it } from "vitest";
describe("PreviewAll.svelte", () => {
beforeEach(() => {
textsState.texts.length = 0;
});
it("should render without crashing", () => {
render(PreviewAll);
const { container } = render(PreviewAll);
expect(container).toBeTruthy();
});
});
@@ -1,13 +1,11 @@
import TextConfig from "$components/text/TextConfig.svelte";
import { cleanup, render } from "@testing-library/svelte";
import { afterEach, describe, it } from "vitest";
afterEach(() => {
cleanup();
});
import { render } from "@testing-library/svelte";
import { describe, expect, it } from "vitest";
describe("TextConfig.svelte", () => {
it("should render without crashing", () => {
render(TextConfig);
const { container } = render(TextConfig);
expect(container).toBeTruthy();
});
});
@@ -2,11 +2,11 @@ import TextInlineEdit from "$components/text/TextInlineEdit.svelte";
import { cleanup, render, screen } from "@testing-library/svelte";
import { afterEach, describe, expect, it } from "vitest";
afterEach(() => {
cleanup();
});
describe("TextInlineEdit.svelte", () => {
afterEach(() => {
cleanup();
});
it("should render with initial text", () => {
render(TextInlineEdit, {
props: {
+3 -1
View File
@@ -24,11 +24,13 @@ describe("Badge.svelte", () => {
});
it("should render with empty string", () => {
render(Badge, {
const { container } = render(Badge, {
props: {
text: "",
},
});
expect(container.textContent?.trim()).toBe("");
});
it("should render with zero", () => {
+3 -2
View File
@@ -1,6 +1,6 @@
import ColorPicker from "$components/ui/ColorPicker.svelte";
import { render } from "@testing-library/svelte";
import { describe, it } from "vitest";
import { render, screen } from "@testing-library/svelte";
import { describe, expect, it } from "vitest";
describe("ColorPicker.svelte", () => {
it("should render without crashing", () => {
@@ -9,5 +9,6 @@ describe("ColorPicker.svelte", () => {
value: "#ffffff",
},
});
expect(screen.getByRole("button")).toBeInTheDocument();
});
});
+3 -2
View File
@@ -1,6 +1,6 @@
import SelectFont from "$components/ui/SelectFont.svelte";
import { render } from "@testing-library/svelte";
import { describe, it } from "vitest";
import { render, screen } from "@testing-library/svelte";
import { describe, expect, it } from "vitest";
describe("SelectFont.svelte", () => {
it("should render without crashing", () => {
@@ -9,5 +9,6 @@ describe("SelectFont.svelte", () => {
value: "Arial",
},
});
expect(screen.getByRole("combobox")).toBeInTheDocument();
});
});