-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathHtml.test.mjs
More file actions
21 lines (18 loc) · 793 Bytes
/
Html.test.mjs
File metadata and controls
21 lines (18 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// @ts-check
import { assertStrictEquals } from "@std/assert/strict-equals";
import { createElement as h } from "react";
import { renderToStaticMarkup } from "react-dom/server";
import Html from "./Html.mjs";
Deno.test("`Html` used as a React component.", () => {
assertStrictEquals(
renderToStaticMarkup(
h(Html, {
importMapScript: h("script", { id: "importMapScript" }),
headReactRoot: h("meta", { id: "headReactRoot" }),
bodyReactRoot: h("div", { id: "bodyReactRoot" }),
hydrationScript: h("script", { id: "hydrationScript" }),
}),
),
'<html lang="en"><head><script id="importMapScript"></script><meta id="headReactRoot"/></head><body><div id="bodyReactRoot"></div><script id="hydrationScript"></script></body></html>',
);
});