-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
LinkCss.test.mjs
29 lines (25 loc) · 850 Bytes
/
LinkCss.test.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// @ts-check
import { createElement as h } from "react";
import { renderToStaticMarkup } from "react-dom/server";
import { assertStrictEquals } from "std/testing/asserts.ts";
import LinkCss from "./LinkCss.mjs";
Deno.test("`LinkCss` used as a React component, with prop `href` URL absolute.", () => {
assertStrictEquals(
renderToStaticMarkup(
h(LinkCss, {
href: "https://unpkg.com/device-agnostic-ui@10.0.0/global.css",
}),
),
'<link rel="stylesheet" href="https://unpkg.com/device-agnostic-ui@10.0.0/global.css" crossorigin="anonymous"/>',
);
});
Deno.test("`LinkCss` used as a React component, with prop `href` URL relative.", () => {
assertStrictEquals(
renderToStaticMarkup(
h(LinkCss, {
href: "/global.css",
}),
),
'<link rel="stylesheet" href="/global.css"/>',
);
});