fix theme navigation and improve project scaffolding

This commit is contained in:
2026-07-12 16:26:06 +05:30
parent ee98026cc5
commit b21e298d85
33 changed files with 143 additions and 26 deletions
+13
View File
@@ -91,3 +91,16 @@ test("exposes programmatic navigation", async () => {
expect(fetchCalls.length).toBe(1);
expect(win.document.getElementById("app").innerHTML).toContain("Dashboard");
});
test("rebinds theme controls after swapping the page", async () => {
install(`<div id="app"><a href="/about" id="lnk">About</a></div>`);
let boundRoot: unknown;
win.wireTheme = { bind: (root: unknown) => (boundRoot = root) };
nextHtml = `<html><body><div id="app"><button data-wire-theme-toggle>Theme</button></div></body></html>`;
win.document.getElementById("lnk").click();
await flush();
expect(boundRoot).toBe(win.document);
expect(win.document.querySelector("[data-wire-theme-toggle]")).not.toBeNull();
});