feat(server): plugins can create islands (#1472)
This commit is contained in:
@@ -107,6 +107,34 @@ Deno.test("plugin route no leading slash", async () => {
|
||||
);
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
name: "plugin supports islands",
|
||||
async fn(t) {
|
||||
await withPageName(
|
||||
"./tests/fixture_plugin/main.ts",
|
||||
async (page, address) => {
|
||||
async function idTest(id: string) {
|
||||
const elem = await page.waitForSelector(`#${id}`);
|
||||
|
||||
const value = await elem?.evaluate((el) => el.textContent);
|
||||
assert(value === `${id}`, `value ${value} not equal to id ${id}`);
|
||||
}
|
||||
|
||||
await page.goto(`${address}/pluginroutewithisland`, {
|
||||
waitUntil: "networkidle2",
|
||||
});
|
||||
|
||||
await t.step("verify tags", async () => {
|
||||
await idTest("csr");
|
||||
await idTest("csr_alt_folder");
|
||||
});
|
||||
},
|
||||
);
|
||||
},
|
||||
sanitizeOps: false,
|
||||
sanitizeResources: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
name: "/with-island hydration",
|
||||
async fn(t) {
|
||||
|
||||
Reference in New Issue
Block a user