feat(tests): add fresh-testing-library tests (#1990)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { assertEquals, assertExists } from "$std/testing/asserts.ts";
|
||||
import { cleanup, render, setup } from "$fresh-testing-library";
|
||||
import { afterEach, beforeAll, describe, it } from "$std/testing/bdd.ts";
|
||||
import Button from "../../../../www/components/gallery/Button.tsx";
|
||||
|
||||
describe("components/gallery/LinkButton.tsx", () => {
|
||||
beforeAll(setup);
|
||||
afterEach(cleanup);
|
||||
|
||||
it("should show button", () => {
|
||||
const { getByRole } = render(
|
||||
<Button value="Click Me!" />,
|
||||
);
|
||||
const button = getByRole("button");
|
||||
assertExists(button);
|
||||
assertEquals((button as HTMLButtonElement).value, "Click Me!");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user