fix: only render keyed comments when needed (#1859)

This commit is contained in:
Marvin Hagemeister
2023-10-04 22:07:06 +02:00
committed by GitHub
parent 0e58c6b475
commit 3b73449a93
5 changed files with 77 additions and 37 deletions
+8
View File
@@ -1,6 +1,7 @@
import { assertEquals, assertMatch } from "$std/testing/asserts.ts";
import { Page } from "./deps.ts";
import {
assertNoComments,
assertNoPageComments,
assertNotSelector,
assertSelector,
@@ -534,6 +535,13 @@ Deno.test("reconciles keyed non island components", async () => {
);
});
Deno.test("don't serialize keys for nodes outside islands or partials", async () => {
await withFakeServe("./tests/fixture_partials/main.ts", async (server) => {
const doc = await server.getHtml("/keys_outside");
assertNoComments(doc);
});
});
Deno.test("partial injection mode", async () => {
await withPageName(
"./tests/fixture_partials/main.ts",