fix: move empty text logic to state, fix tests

This commit is contained in:
2026-02-08 21:33:15 +05:00
parent 59745eac4f
commit a146fee41c
4 changed files with 23 additions and 88 deletions
@@ -1,14 +1,18 @@
import TextManager from "$components/text/TextManager.svelte";
import { textsState } from "$states/texts.svelte";
import { render } from "@testing-library/svelte";
import { beforeEach, describe, it } from "vitest";
import { render, screen } from "@testing-library/svelte";
import { beforeEach, describe, expect, it } from "vitest";
describe("TextManager.svelte", () => {
beforeEach(() => {
textsState.texts.length = 0;
while (textsState.texts.length > 0) {
textsState.texts.pop();
}
});
it("should render without crashing", () => {
render(TextManager);
const cardTitle = screen.getByText("Тексты панелей");
expect(cardTitle).toBeInTheDocument();
});
});