release: WRNexusJS 0.4.0

This commit is contained in:
2026-07-27 12:42:18 +05:30
parent 8b728a3e5d
commit 30e5721e84
250 changed files with 10065 additions and 3923 deletions
+22
View File
@@ -104,3 +104,25 @@ test("rebinds theme controls after swapping the page", async () => {
expect(boundRoot).toBe(win.document);
expect(win.document.querySelector("[data-wire-theme-toggle]")).not.toBeNull();
});
test("unmounts and remounts package runtimes during client navigation", async () => {
install(
`<div id="app"><div data-wrnexus-runtime="captcha">Old</div><a href="/next" id="lnk">Next</a></div>`,
);
let mounts = 0;
let unmounts = 0;
win.__wrnexusRuntimes = {
captcha: {
mount: () => mounts++,
unmount: () => unmounts++,
},
};
nextHtml = `<html><body><div id="app"><div data-wrnexus-runtime="captcha">New</div></div></body></html>`;
win.document.getElementById("lnk").click();
await flush();
expect(unmounts).toBe(1);
expect(mounts).toBe(1);
expect(win.document.getElementById("app").textContent).toContain("New");
});