import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { describe, expect, it, vi } from "vitest"; import { App } from "../../src/App"; describe("Git Tools", () => { it("renders the local workbench and ignore explanations", async () => { vi.stubGlobal( "fetch", vi.fn(async () => new Response("Not found", { status: 404 })), ); render(); expect( await screen.findByRole("heading", { name: "Git Tools" }), ).toBeVisible(); await userEvent.click( await screen.findByRole("tab", { name: ".gitignore" }), ); expect(screen.getAllByText(/Last matching rule/u).length).toBeGreaterThan( 0, ); expect(screen.getByText("Browser-local")).toBeVisible(); }); });