Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
whateverfw committed Feb 28, 2025
1 parent 0340e11 commit ae6cbe3
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions margin_frontend/test/HelloWorld.spec.test.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { describe, it } from "vitest";
import HelloWorld from "../components/HelloWorld";
import { Title } from "../src/ui/layout/title";

describe("HelloWorld test component", () => {
it("renders name and counter works", async () => {
render(<HelloWorld name="Vitest" />);
describe("Vitest test component", () => {
it("renders title", async () => {
render(<Title title="Vitest" />);

await screen.findByText("Hello Vitest x1!");
await userEvent.click(screen.getByRole("button", { name: "Increment" }));

await screen.findByText("Hello Vitest x2!");
});
await screen.findByText("Vitest");
});
});

0 comments on commit ae6cbe3

Please sign in to comment.