fix: head text nodes rendered into body (#2015)

This commit is contained in:
Marvin Hagemeister
2023-11-06 11:45:33 +01:00
committed by GitHub
parent e0f503ee37
commit 33cc4c7866
4 changed files with 39 additions and 8 deletions
+9
View File
@@ -1,5 +1,6 @@
import {
assertSelector,
assertTextMany,
parseHtml,
withFakeServe,
} from "$fresh/tests/test_utils.ts";
@@ -46,3 +47,11 @@ Deno.test("render headers passed to ctx.render()", async () => {
await res.body?.cancel();
});
});
Deno.test("render head text nodes", async () => {
await withFakeServe("./tests/fixture_render/main.ts", async (server) => {
const doc = await server.getHtml("/head_style");
assertTextMany(doc, "style", ["body { color: red }"]);
assertEquals(doc.body.textContent, "hello");
});
});