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,11 +1,12 @@
import { render } from "@testing-library/svelte";
import { render, screen } from "@testing-library/svelte";
import { describe, expect, it } from "vitest";
import InputGroupTest from "./InputGroupTest.svelte";
describe("InputGroup.svelte", () => {
it("should render without crashing", () => {
render(InputGroupTest);
const inputGroup = document.querySelector(".input-group");
expect(inputGroup).toBeInTheDocument();
expect(screen.getByTestId("input1")).toBeInTheDocument();
expect(screen.getByTestId("input2")).toBeInTheDocument();
expect(screen.getByTestId("button")).toBeInTheDocument();
});
});