fix: head text nodes rendered into body (#2015)
This commit is contained in:
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user