|
1 | 1 | import { fireEvent, render, screen, waitFor } from "@testing-library/react"; |
2 | 2 | import { beforeEach, describe, expect, it, vi } from "vitest"; |
3 | 3 | import { ArtifactPreview } from "./ArtifactPreview"; |
4 | | -import { artifactHtmlDocument, artifactPreviewBlob } from "./artifactPreviewDocument"; |
| 4 | +import { |
| 5 | + artifactHtmlDocument, |
| 6 | + artifactPreviewBlob, |
| 7 | +} from "./artifactPreviewDocument"; |
5 | 8 |
|
6 | 9 | const previewBlob = new Blob(["<h1>Artifact content</h1>"], { |
7 | 10 | type: "text/html", |
@@ -235,13 +238,17 @@ describe("ArtifactPreview", () => { |
235 | 238 |
|
236 | 239 | expect(screen.getByRole("heading", { name: "Report" })).toBeInTheDocument(); |
237 | 240 | expect(screen.getByRole("table")).toBeInTheDocument(); |
238 | | - expect(container.querySelector(".plan-markdown.mx-auto")).toBeInTheDocument(); |
| 241 | + expect( |
| 242 | + container.querySelector(".plan-markdown.mx-auto"), |
| 243 | + ).toBeInTheDocument(); |
239 | 244 | expect(screen.getByText("report.md")).toBeInTheDocument(); |
240 | 245 |
|
241 | 246 | fireEvent.click(screen.getByRole("button", { name: "View source" })); |
242 | 247 |
|
243 | 248 | expect(screen.getByTestId("source-view")).toHaveTextContent("# Report"); |
244 | | - expect(screen.getByRole("button", { name: "View preview" })).toBeInTheDocument(); |
| 249 | + expect( |
| 250 | + screen.getByRole("button", { name: "View preview" }), |
| 251 | + ).toBeInTheDocument(); |
245 | 252 | }); |
246 | 253 |
|
247 | 254 | it("blocks network subresources in HTML artifacts", () => { |
|
0 commit comments