The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { expect, it, vi } from "vite-plus/test"; |
| 2 | import { page } from "vite-plus/test/browser"; |
| 3 | |
| 4 | import { render } from "../../../test/render"; |
| 5 | import { APP_VERSION } from "../../branding"; |
| 6 | import { AnchoredToastProvider } from "../ui/toast"; |
| 7 | import { AboutVersionTitle } from "./AboutVersionTitle"; |
| 8 | |
| 9 | it("copies the version without a notification", async () => { |
| 10 | await using screen = await render( |
| 11 | <AnchoredToastProvider> |
| 12 | <AboutVersionTitle /> |
| 13 | </AnchoredToastProvider>, |
| 14 | ); |
| 15 | using write = vi.spyOn(navigator.clipboard, "writeText").mockResolvedValue(undefined); |
| 16 | |
| 17 | await screen.getByRole("button", { name: `Copy version ${APP_VERSION}` }).click(); |
| 18 | |
| 19 | expect(write).toHaveBeenCalledWith(APP_VERSION); |
| 20 | await expect.element(page.getByText(/^Copied!?$/)).not.toBeInTheDocument(); |
| 21 | }); |