Skip to content
Source
Sign inSign up
Open History to see the last commit

toast.browser.test.tsx

15 lines571 Bytes

1import { describe, expect, it } from "vite-plus/test";
2import { page } from "vite-plus/test/browser";
3​
4import { render } from "../../../test/render";
5import { ToastProvider, toastManager } from "./toast";
6​
7describe("toastManager", () => {
8 it("shows a toast added before any provider mounted", async () => {
9 toastManager.add({ type: "info", title: "Raised before the first render" });
10​
11 await using _screen = await render(<ToastProvider>{null}</ToastProvider>);
12​
13 await expect.element(page.getByText("Raised before the first render")).toBeVisible();
14 });
15});