Skip to content

A tiny friend in your Mac's notch and on your iPhone that keeps an eye on your AI coding agents: Claude Code, Codex, Cursor, Gemini CLI, Antigravity and more. Approve from the notch or your Lock Screen.

test(windows): fake DOM detaches removed children and has prepend

Claude100bf5330202
diff --git a/windows/tests/fakedom.mjs b/windows/tests/fakedom.mjs
index 3617e359..b0632533 100644
--- a/windows/tests/fakedom.mjs
+++ b/windows/tests/fakedom.mjs
@@ -93,12 +93,20 @@ class FakeElement {
this.childNodes.push(node);
}
}
+ prepend(...nodes) {
+ const added = nodes.map((n) => (typeof n === "string" ? new FakeText(n) : n));
+ for (const node of added) node.parentNode = this;
+ this.childNodes.unshift(...added);
+ }
replaceChildren(...nodes) {
+ // As in a real DOM, the old children no longer have a parent.
+ for (const old of this.childNodes) old.parentNode = null;
this.childNodes = [];
this.append(...nodes);
}
removeChild(node) {
this.childNodes = this.childNodes.filter((n) => n !== node);
+ node.parentNode = null;
return node;
}
remove() {