Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

test(composer): align the native paragraph guard contract

Tioit-Wang3083e6a78fbb
diff --git a/apps/desktop/test/composer-native-deletion.test.mjs b/apps/desktop/test/composer-native-deletion.test.mjs
index c1f05b2e5..150f0f07a 100644
--- a/apps/desktop/test/composer-native-deletion.test.mjs
+++ b/apps/desktop/test/composer-native-deletion.test.mjs
@@ -25,10 +25,8 @@ test("one Enter is one newline, owned by the editor at the draft end only", () =
assert.match(deletionSource, /atDraftEnd\(\)/);
assert.match(deletionSource, /editorSelectionRange\(editor\)\.end === readEditorValue\(editor\)\.length/);
assert.match(deletionSource, /event\.preventDefault\(\);\n\s+onInsertLineBreak\(\);/);
- // A break anywhere else is exactly one newline natively and stays in the undo
- // stack, so the guard must not take it over.
- assert.match(deletionSource, /A break anywhere else is exactly one newline/);
+ // Paragraph boundaries must not introduce uncounted block wrappers.
+ assert.match(deletionSource, /editor\.ownerDocument\.execCommand\("insertLineBreak"\)/);
// React never dispatches the synthetic beforeinput event, so the guard owns it.
assert.doesNotMatch(inputSource, /onBeforeInput/);
});
-
diff --git a/apps/desktop/test/composer-tail-line.test.mjs b/apps/desktop/test/composer-tail-line.test.mjs
index 4d3663b02..015d79fad 100644
--- a/apps/desktop/test/composer-tail-line.test.mjs
+++ b/apps/desktop/test/composer-tail-line.test.mjs
@@ -66,4 +66,3 @@ test("the end-of-draft break is one native edit, so undo takes both nodes", () =
// that refuses insertHTML.
assert.ok(draft.indexOf("execCommand") < draft.indexOf("range.insertNode"));
});
-