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

PreviewChromeRow.test.tsx

24 lines761 Bytes

1import { renderToStaticMarkup } from "react-dom/server";
2import { describe, expect, it, vi } from "vite-plus/test";
3​
4import { PreviewChromeRow } from "./PreviewChromeRow";
5​
6describe("PreviewChromeRow", () => {
7 it("shows the complete URL while the address bar is not focused", () => {
8 const markup = renderToStaticMarkup(
9 <PreviewChromeRow
10 url="https://example.com/dashboard?mode=edit&tab=1#notes"
11 loading={false}
12 canGoBack={false}
13 canGoForward={false}
14 refreshDisabled={false}
15 onBack={vi.fn()}
16 onForward={vi.fn()}
17 onRefresh={vi.fn()}
18 onSubmit={vi.fn()}
19 />,
20 );
21​
22 expect(markup).toContain('value="https://example.com/dashboard?mode=edit&amp;tab=1#notes"');
23 });
24});