fix: rendering islands inside other islands (#1295)

This commit is contained in:
Marvin Hagemeister
2023-06-15 17:55:17 +02:00
committed by GitHub
parent a1d266f0d3
commit 80306563d2
5 changed files with 155 additions and 16 deletions
+31
View File
@@ -344,6 +344,37 @@ Deno.test({
sanitizeResources: false,
});
Deno.test({
name: "render island inside island definition",
async fn(_t) {
await withPageName(
"./tests/fixture_island_nesting/main.ts",
async (page, address) => {
await page.goto(`${address}/island_in_island_definition`, {
waitUntil: "networkidle2",
});
await page.waitForSelector(".island");
await delay(100);
const text = await page.$eval(
".island .island p",
(el) => el.textContent,
);
assertEquals(text, "it works");
// Check that there is no duplicated content which could happen
// when islands aren't initialized correctly
const pageText = await page.$eval("#page", (el) => el.textContent);
assertEquals(pageText, "it works");
},
);
},
sanitizeOps: false,
sanitizeResources: false,
});
Deno.test({
name:
"render island with JSX children that render another island with JSX children",