feat(create): wizard uploads render as images in display and exports (imageUrl/fileUrl)

This commit is contained in:
adilallo
2026-05-08 21:38:18 -06:00
parent 026a1e6d71
commit 89fd5f3ade
7 changed files with 170 additions and 13 deletions
+23 -1
View File
@@ -1,9 +1,11 @@
import { describe } from "vitest";
import { describe, it, expect } from "vitest";
import {
componentTestSuite,
type ComponentTestSuiteConfig,
} from "../utils/componentTestSuite";
import TextBlock from "../../app/components/type/TextBlock";
import { screen } from "@testing-library/react";
import { renderWithProviders as render } from "../utils/test-utils";
type Props = React.ComponentProps<typeof TextBlock>;
@@ -23,4 +25,24 @@ const config: ComponentTestSuiteConfig<Props> = {
describe("TextBlock", () => {
componentTestSuite<Props>(config);
it("renders labeled row imageUrl as img", () => {
render(
<TextBlock
title="Entry"
rows={[
{
label: "Photo",
body: "",
imageUrl: "/api/uploads/aaaaaaaa-bbbb-4ccc-dddd-eeeeeeeeeeee",
},
]}
/>,
);
const img = screen.getByRole("img", { name: "Photo" });
expect(img).toHaveAttribute(
"src",
"/api/uploads/aaaaaaaa-bbbb-4ccc-dddd-eeeeeeeeeeee",
);
});
});