test: make tests less fragile

This commit is contained in:
2026-02-09 09:57:39 +05:00
parent 2bbe59107c
commit c4103e937d
12 changed files with 49 additions and 55 deletions
@@ -1,5 +1,5 @@
import PreviewControls from "$components/panel/PreviewControls.svelte";
import { cleanup, render } from "@testing-library/svelte";
import { cleanup, render, screen } from "@testing-library/svelte";
import { afterEach, describe, expect, it } from "vitest";
afterEach(() => {
@@ -16,7 +16,7 @@ describe("PreviewControls.svelte", () => {
},
});
const buttons = document.querySelectorAll("button");
const buttons = screen.getAllByRole("button");
expect(buttons.length).toBeGreaterThan(0);
});
});