fix: partial hash navigation causing loop (#1838)
This commit is contained in:
+20
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user