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

PreviewChromeRow.test.tsx

25 lines786 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 loadProgress={0}
13 canGoBack={false}
14 canGoForward={false}
15 refreshDisabled={false}
16 onBack={vi.fn()}
17 onForward={vi.fn()}
18 onRefresh={vi.fn()}
19 onSubmit={vi.fn()}
20 />,
21 );
22​
23 expect(markup).toContain('value="https://example.com/dashboard?mode=edit&amp;tab=1#notes"');
24 });
25});