fix: partial hash navigation causing loop (#1838)

This commit is contained in:
Marvin Hagemeister
2023-10-02 16:24:09 +02:00
committed by GitHub
parent a4ed93bfac
commit d638c526f5
4 changed files with 132 additions and 95 deletions
+20 -2
View File
@@ -887,8 +887,26 @@ Deno.test("submit form", async () => {
);
});
Deno.test("fragment navigation should not cause loop", async () => {
await withPageName(
"./tests/fixture_partials/main.ts",
async (page, address) => {
page.setDefaultTimeout(2000);
const logs: string[] = [];
page.on("console", (msg) => logs.push(msg.text()));
const initialUrl = `${address}/fragment_nav`;
await page.goto(initialUrl);
await page.waitForSelector(".partial-text");
await page.click("a");
await page.waitForFunction(() => location.hash === "#foo");
assertEquals(logs, []);
},
);
});
// TODO Head merging
// TODO Active links
// TODO Children Keys
// TODO Leftover comments
// TODO HTML validation