fix(forge): ne plus ecraser une completion acceptee au Tab (BUG-055)
This commit is contained in:
@@ -202,6 +202,25 @@ test("Forge ghost text no longer mirrors the whole document", () => {
|
||||
assert.ok(!FORGE_HTML.includes("ghostOverlay.innerHTML"), "the mirror overlay must be gone");
|
||||
});
|
||||
|
||||
test("Forge ignores its own autosave reload while the buffer is dirty (BUG-055)", () => {
|
||||
assert.ok(
|
||||
FORGE_HTML.includes("if (!e.data.force && isDirty) return;"),
|
||||
"parent-reload must not clobber unsaved local edits",
|
||||
);
|
||||
});
|
||||
|
||||
test("Forge cancels a pending ghost request when the prediction is accepted", () => {
|
||||
const fn = FORGE_HTML.match(/function acceptGhost\(\) \{([\s\S]*?)\n \}/);
|
||||
assert.ok(fn, "acceptGhost not found");
|
||||
assert.match(fn[1], /clearTimeout\(_ghostTimer\)/);
|
||||
});
|
||||
|
||||
test("Forge autosave keeps the buffer dirty if edits arrive during the request", () => {
|
||||
const fn = FORGE_HTML.match(/function autoSave\(\) \{([\s\S]*?)\n \}/);
|
||||
assert.ok(fn, "autoSave not found");
|
||||
assert.match(fn[1], /if \(val\(\) !== content\) \{ scheduleAutoSave\(\); return; \}/);
|
||||
});
|
||||
|
||||
// ── Summary ────────────────────────────────────────────────────────────────
|
||||
console.log(`\n${testCount} passed, ${failCount} failed`);
|
||||
process.exit(failCount > 0 ? 1 : 0);
|
||||
|
||||
Reference in New Issue
Block a user