test: refactor tests, format files
This commit is contained in:
@@ -7,6 +7,4 @@ describe("CropInline.svelte", () => {
|
|||||||
const { container } = render(CropInline);
|
const { container } = render(CropInline);
|
||||||
expect(container).toBeInTheDocument();
|
expect(container).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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 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", () => {
|
describe("AppHeader.svelte", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
themeState.theme = "dark";
|
themeState.theme = "dark";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
it("should toggle theme on button click", async () => {
|
it("should toggle theme on button click", async () => {
|
||||||
const { container } = render(AppHeader);
|
const { container } = render(AppHeader);
|
||||||
|
|
||||||
@@ -23,6 +21,4 @@ describe("AppHeader.svelte", () => {
|
|||||||
await fireEvent.click(toggleButton);
|
await fireEvent.click(toggleButton);
|
||||||
expect(themeState.theme).toBe("dark");
|
expect(themeState.theme).toBe("dark");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { render, screen } from "@testing-library/svelte";
|
import { render } from "@testing-library/svelte";
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import CardTest from "./CardTest.svelte";
|
import CardTest from "./CardTest.svelte";
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
<!-- CardTest.svelte -->
|
|
||||||
<script>
|
<script>
|
||||||
import Card from "$components/layout/Card.svelte";
|
import Card from "$components/layout/Card.svelte";
|
||||||
</script>
|
</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 { describe, expect, it } from "vitest";
|
||||||
import InputGroupTest from "./InputGroupTest.svelte";
|
import InputGroupTest from "./InputGroupTest.svelte";
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
<!-- InputGroupTest.svelte -->
|
|
||||||
<script>
|
<script>
|
||||||
import InputGroup from "$components/layout/InputGroup.svelte";
|
import InputGroup from "$components/layout/InputGroup.svelte";
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -7,6 +7,4 @@ describe("PanelBar.svelte", () => {
|
|||||||
const { container } = render(PanelBar);
|
const { container } = render(PanelBar);
|
||||||
expect(container).toBeInTheDocument();
|
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 { describe, expect, it } from "vitest";
|
||||||
import SettingsGridTest from "./SettingsGridTest.svelte";
|
import SettingsGridTest from "./SettingsGridTest.svelte";
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
<!-- SettingsGridTest.svelte -->
|
|
||||||
<script>
|
<script>
|
||||||
import SettingsGrid from "$components/layout/SettingsGrid.svelte";
|
import SettingsGrid from "$components/layout/SettingsGrid.svelte";
|
||||||
</script>
|
</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 { describe, expect, it } from "vitest";
|
||||||
import SettingsRowTest from "./SettingsRowTest.svelte";
|
import SettingsRowTest from "./SettingsRowTest.svelte";
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
<!-- SettingsRowTest.svelte -->
|
|
||||||
<script>
|
<script>
|
||||||
import SettingsRow from "$components/layout/SettingsRow.svelte";
|
import SettingsRow from "$components/layout/SettingsRow.svelte";
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -7,6 +7,4 @@ describe("TextBar.svelte", () => {
|
|||||||
const { container } = render(TextBar);
|
const { container } = render(TextBar);
|
||||||
expect(container).toBeInTheDocument();
|
expect(container).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import Preview from "$components/panel/Preview.svelte";
|
import Preview from "$components/panel/Preview.svelte";
|
||||||
import { render, cleanup } from "@testing-library/svelte";
|
import { cleanup, render } from "@testing-library/svelte";
|
||||||
import { describe, expect, it, afterEach } from "vitest";
|
import { afterEach, describe, expect, it } from "vitest";
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
@@ -29,6 +29,4 @@ describe("Preview.svelte", () => {
|
|||||||
const stage = container.querySelector("canvas");
|
const stage = container.querySelector("canvas");
|
||||||
expect(stage).toBeInTheDocument();
|
expect(stage).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import PreviewAll from "$components/panel/PreviewAll.svelte";
|
import PreviewAll from "$components/panel/PreviewAll.svelte";
|
||||||
import { textsState } from "$states/texts.svelte";
|
import { textsState } from "$states/texts.svelte";
|
||||||
import { render, screen } from "@testing-library/svelte";
|
import { render } from "@testing-library/svelte";
|
||||||
import { beforeEach, describe, expect, it } from "vitest";
|
import { beforeEach, describe, it } from "vitest";
|
||||||
|
|
||||||
describe("PreviewAll.svelte", () => {
|
describe("PreviewAll.svelte", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
import PreviewControls from "$components/panel/PreviewControls.svelte";
|
import PreviewControls from "$components/panel/PreviewControls.svelte";
|
||||||
import { render, screen, cleanup } from "@testing-library/svelte";
|
import { cleanup, render } from "@testing-library/svelte";
|
||||||
import { describe, expect, it, afterEach } from "vitest";
|
import { afterEach, describe, expect, it } from "vitest";
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("PreviewControls.svelte", () => {
|
describe("PreviewControls.svelte", () => {
|
||||||
|
|
||||||
|
|
||||||
it("should render navigation buttons", () => {
|
it("should render navigation buttons", () => {
|
||||||
render(PreviewControls, {
|
render(PreviewControls, {
|
||||||
props: {
|
props: {
|
||||||
@@ -21,8 +19,4 @@ describe("PreviewControls.svelte", () => {
|
|||||||
const buttons = document.querySelectorAll("button");
|
const buttons = document.querySelectorAll("button");
|
||||||
expect(buttons.length).toBeGreaterThan(0);
|
expect(buttons.length).toBeGreaterThan(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import PreviewManager from "$components/panel/PreviewManager.svelte";
|
import PreviewManager from "$components/panel/PreviewManager.svelte";
|
||||||
import { textsState } from "$states/texts.svelte";
|
import { textsState } from "$states/texts.svelte";
|
||||||
import { render, screen } from "@testing-library/svelte";
|
import { render } from "@testing-library/svelte";
|
||||||
import { beforeEach, describe, expect, it } from "vitest";
|
import { beforeEach, describe, it } from "vitest";
|
||||||
|
|
||||||
describe("PreviewManager.svelte", () => {
|
describe("PreviewManager.svelte", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import TextConfig from "$components/text/TextConfig.svelte";
|
import TextConfig from "$components/text/TextConfig.svelte";
|
||||||
import { render, screen, cleanup } from "@testing-library/svelte";
|
import { cleanup, render } from "@testing-library/svelte";
|
||||||
import { describe, expect, it, afterEach } from "vitest";
|
import { afterEach, describe, it } from "vitest";
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
@@ -10,8 +10,4 @@ describe("TextConfig.svelte", () => {
|
|||||||
it("should render without crashing", () => {
|
it("should render without crashing", () => {
|
||||||
render(TextConfig);
|
render(TextConfig);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import TextInlineEdit from "$components/text/TextInlineEdit.svelte";
|
import TextInlineEdit from "$components/text/TextInlineEdit.svelte";
|
||||||
import { render, cleanup } from "@testing-library/svelte";
|
import { cleanup, render } from "@testing-library/svelte";
|
||||||
import { describe, expect, it, afterEach } from "vitest";
|
import { afterEach, describe, expect, it } from "vitest";
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
@@ -21,8 +21,6 @@ describe("TextInlineEdit.svelte", () => {
|
|||||||
expect(input).toHaveValue("Test text");
|
expect(input).toHaveValue("Test text");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
it("should render with empty text", () => {
|
it("should render with empty text", () => {
|
||||||
render(TextInlineEdit, {
|
render(TextInlineEdit, {
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { render, screen, fireEvent } from "@testing-library/svelte";
|
|
||||||
import { describe, expect, it, vi } from "vitest";
|
|
||||||
import TextInput from "$components/text/TextInput.svelte";
|
import TextInput from "$components/text/TextInput.svelte";
|
||||||
|
import { fireEvent, render } from "@testing-library/svelte";
|
||||||
|
import { describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
describe("TextInput.svelte", () => {
|
describe("TextInput.svelte", () => {
|
||||||
it("should render with initial value", () => {
|
it("should render with initial value", () => {
|
||||||
@@ -63,6 +63,4 @@ describe("TextInput.svelte", () => {
|
|||||||
|
|
||||||
expect(onenter).not.toHaveBeenCalled();
|
expect(onenter).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import TextManager from "$components/text/TextManager.svelte";
|
import TextManager from "$components/text/TextManager.svelte";
|
||||||
import { textsState } from "$states/texts.svelte";
|
import { textsState } from "$states/texts.svelte";
|
||||||
import { render, screen } from "@testing-library/svelte";
|
import { render } from "@testing-library/svelte";
|
||||||
import { beforeEach, describe, expect, it } from "vitest";
|
import { beforeEach, describe, it } from "vitest";
|
||||||
|
|
||||||
describe("TextManager.svelte", () => {
|
describe("TextManager.svelte", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
import Badge from "$components/ui/Badge.svelte";
|
||||||
import { render, screen } from "@testing-library/svelte";
|
import { render, screen } from "@testing-library/svelte";
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import Badge from "$components/ui/Badge.svelte";
|
|
||||||
|
|
||||||
describe("Badge.svelte", () => {
|
describe("Badge.svelte", () => {
|
||||||
it("should render with string text", () => {
|
it("should render with string text", () => {
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import { render, screen, fireEvent } from "@testing-library/svelte";
|
|
||||||
import { describe, expect, it, vi } from "vitest";
|
|
||||||
import Button from "$components/ui/Button.svelte";
|
import Button from "$components/ui/Button.svelte";
|
||||||
import MockIcon from "./__mocks__/MockIcon.svelte";
|
import { fireEvent, render, screen } from "@testing-library/svelte";
|
||||||
|
import { describe, expect, it, vi } from "vitest";
|
||||||
|
import MockIcon from "./MockIcon.svelte";
|
||||||
|
|
||||||
describe("Button.svelte", () => {
|
describe("Button.svelte", () => {
|
||||||
|
|
||||||
it("should render with icon and label", () => {
|
it("should render with icon and label", () => {
|
||||||
const { container } = render(Button, {
|
const { container } = render(Button, {
|
||||||
props: {
|
props: {
|
||||||
@@ -68,6 +67,4 @@ describe("Button.svelte", () => {
|
|||||||
const button = container.querySelector("button");
|
const button = container.querySelector("button");
|
||||||
expect(button).not.toBeDisabled();
|
expect(button).not.toBeDisabled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import ColorPicker from "$components/ui/ColorPicker.svelte";
|
import ColorPicker from "$components/ui/ColorPicker.svelte";
|
||||||
import { fireEvent, render, screen } from "@testing-library/svelte";
|
import { render } from "@testing-library/svelte";
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, it } from "vitest";
|
||||||
|
|
||||||
describe("ColorPicker.svelte", () => {
|
describe("ColorPicker.svelte", () => {
|
||||||
it("should render without crashing", () => {
|
it("should render without crashing", () => {
|
||||||
@@ -10,6 +10,4 @@ describe("ColorPicker.svelte", () => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 96 B After Width: | Height: | Size: 96 B |
@@ -1,10 +1,8 @@
|
|||||||
import RangeSlider from "$components/ui/RangeSlider.svelte";
|
import RangeSlider from "$components/ui/RangeSlider.svelte";
|
||||||
import { fireEvent, render, screen } from "@testing-library/svelte";
|
import { fireEvent, render } from "@testing-library/svelte";
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
describe("RangeSlider.svelte", () => {
|
describe("RangeSlider.svelte", () => {
|
||||||
|
|
||||||
|
|
||||||
it("should call onchange handler", async () => {
|
it("should call onchange handler", async () => {
|
||||||
const onchange = vi.fn();
|
const onchange = vi.fn();
|
||||||
const { container } = render(RangeSlider, {
|
const { container } = render(RangeSlider, {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import SelectFont from "$components/ui/SelectFont.svelte";
|
import SelectFont from "$components/ui/SelectFont.svelte";
|
||||||
import { fireEvent, render, screen } from "@testing-library/svelte";
|
import { render } from "@testing-library/svelte";
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, it } from "vitest";
|
||||||
|
|
||||||
describe("SelectFont.svelte", () => {
|
describe("SelectFont.svelte", () => {
|
||||||
it("should render without crashing", () => {
|
it("should render without crashing", () => {
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import {
|
import {
|
||||||
PANEL_SETTINGS,
|
DEFAULT_TEXT_ALIGN,
|
||||||
TYPOGRAPHY,
|
|
||||||
IMAGE_SETTINGS,
|
IMAGE_SETTINGS,
|
||||||
|
PANEL_SETTINGS,
|
||||||
SlideDirection,
|
SlideDirection,
|
||||||
type SlideDirectionType,
|
type SlideDirectionType,
|
||||||
TextAlign,
|
TextAlign,
|
||||||
type TextAlignType,
|
type TextAlignType,
|
||||||
DEFAULT_TEXT_ALIGN,
|
TYPOGRAPHY,
|
||||||
} from "$lib/constants";
|
} from "$lib/constants";
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ describe("constants", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should have string format types", () => {
|
it("should have string format types", () => {
|
||||||
IMAGE_SETTINGS.SUPPORTED_FORMATS.forEach(format => {
|
IMAGE_SETTINGS.SUPPORTED_FORMATS.forEach((format) => {
|
||||||
expect(typeof format).toBe("string");
|
expect(typeof format).toBe("string");
|
||||||
expect(format).toMatch(/^image\//);
|
expect(format).toMatch(/^image\//);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AppError, ImageError, TextError, CanvasError, StorageError } from "$lib/error.types";
|
import { AppError, CanvasError, ImageError, StorageError, TextError } from "$lib/error.types";
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
|
|
||||||
describe("error.types", () => {
|
describe("error.types", () => {
|
||||||
@@ -153,7 +153,7 @@ describe("error.types", () => {
|
|||||||
new StorageError("Test"),
|
new StorageError("Test"),
|
||||||
];
|
];
|
||||||
|
|
||||||
errors.forEach(error => {
|
errors.forEach((error) => {
|
||||||
expect(error).toBeInstanceOf(AppError);
|
expect(error).toBeInstanceOf(AppError);
|
||||||
expect(error).toBeInstanceOf(Error);
|
expect(error).toBeInstanceOf(Error);
|
||||||
});
|
});
|
||||||
@@ -165,8 +165,8 @@ describe("error.types", () => {
|
|||||||
new TextError("Test"),
|
new TextError("Test"),
|
||||||
];
|
];
|
||||||
|
|
||||||
const imageErrors = errors.filter(e => e instanceof ImageError);
|
const imageErrors = errors.filter((e) => e instanceof ImageError);
|
||||||
const textErrors = errors.filter(e => e instanceof TextError);
|
const textErrors = errors.filter((e) => e instanceof TextError);
|
||||||
|
|
||||||
expect(imageErrors).toHaveLength(1);
|
expect(imageErrors).toHaveLength(1);
|
||||||
expect(textErrors).toHaveLength(1);
|
expect(textErrors).toHaveLength(1);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { AppError, ImageError, TextError, CanvasError, StorageError } from "$lib/error.types";
|
import { AppError, CanvasError, ImageError, StorageError, TextError } from "$lib/error.types";
|
||||||
import { formatError, createError, logError } from "$lib/utils/errorUtils";
|
import { createError, formatError, logError } from "$lib/utils/errorUtils";
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
describe("errorUtils", () => {
|
describe("errorUtils", () => {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
<!-- LayoutTest.svelte -->
|
|
||||||
<script>
|
<script>
|
||||||
import Layout from "$routes/+layout.svelte";
|
import Layout from "$routes/+layout.svelte";
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
<!-- PageTest.svelte -->
|
|
||||||
<script>
|
<script>
|
||||||
import Page from "$routes/+page.svelte";
|
import Page from "$routes/+page.svelte";
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { themeState } from "$states/theme.svelte";
|
import { themeState } from "$states/theme.svelte";
|
||||||
|
import { render, screen } from "@testing-library/svelte";
|
||||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
import LayoutTest from "./LayoutTest.svelte";
|
||||||
|
|
||||||
describe("+layout.svelte", () => {
|
describe("+layout.svelte", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -27,9 +29,6 @@ describe("+layout.svelte", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
import LayoutTest from "./LayoutTest.svelte";
|
|
||||||
import { render, screen } from "@testing-library/svelte";
|
|
||||||
|
|
||||||
describe("Layout Component Coverage", () => {
|
describe("Layout Component Coverage", () => {
|
||||||
it("should render children snippet and initialize props", () => {
|
it("should render children snippet and initialize props", () => {
|
||||||
render(LayoutTest);
|
render(LayoutTest);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { render, screen } from "@testing-library/svelte";
|
import { render } from "@testing-library/svelte";
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import PageTest from "./PageTest.svelte";
|
import PageTest from "./PageTest.svelte";
|
||||||
|
|
||||||
|
|||||||
@@ -51,37 +51,4 @@ describe("konvaStage.svelte", () => {
|
|||||||
expect(konvaStageState.stage).not.toStrictEqual(firstStage);
|
expect(konvaStageState.stage).not.toStrictEqual(firstStage);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// describe("stage lifecycle", () => {
|
|
||||||
// it("should handle stage creation", () => {
|
|
||||||
// const mockStage = { id: "new-stage" } as any;
|
|
||||||
|
|
||||||
// konvaStageState.stage = mockStage;
|
|
||||||
|
|
||||||
// expect(konvaStageState.stage).toStrictEqual(mockStage);
|
|
||||||
// expect(konvaStageState.stage?.id).toBe("new-stage");
|
|
||||||
// });
|
|
||||||
|
|
||||||
// it("should handle stage destruction", () => {
|
|
||||||
// const mockStage = { id: "to-destroy" } as any;
|
|
||||||
|
|
||||||
// konvaStageState.stage = mockStage;
|
|
||||||
// expect(konvaStageState.stage).toBeDefined();
|
|
||||||
|
|
||||||
// konvaStageState.stage = undefined;
|
|
||||||
// expect(konvaStageState.stage).toBeUndefined();
|
|
||||||
// });
|
|
||||||
|
|
||||||
// it("should handle stage replacement", () => {
|
|
||||||
// const oldStage = { id: "old" } as any;
|
|
||||||
// const newStage = { id: "new" } as any;
|
|
||||||
|
|
||||||
// konvaStageState.stage = oldStage;
|
|
||||||
// expect(konvaStageState.stage).toStrictEqual(oldStage);
|
|
||||||
|
|
||||||
// konvaStageState.stage = newStage;
|
|
||||||
// expect(konvaStageState.stage).toStrictEqual(newStage);
|
|
||||||
// expect(konvaStageState.stage).not.toStrictEqual(oldStage);
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, it } from "vitest";
|
|
||||||
import { themeState } from "$states/theme.svelte";
|
import { themeState } from "$states/theme.svelte";
|
||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
|
||||||
describe("theme.svelte", () => {
|
describe("theme.svelte", () => {
|
||||||
describe("initial state", () => {
|
describe("initial state", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user