Skip to content

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

test(markdown): isolate error clicks from narrow-preview feedback

github-actions[bot]262536a3c6d7
diff --git a/apps/desktop/test/fixtures/markdown-table-runner.cjs b/apps/desktop/test/fixtures/markdown-table-runner.cjs
index 573a42d6b..d1508df97 100644
--- a/apps/desktop/test/fixtures/markdown-table-runner.cjs
+++ b/apps/desktop/test/fixtures/markdown-table-runner.cjs
@@ -93,6 +93,10 @@ app.whenReady().then(async () => {
await key("Escape");
await wait('!document.querySelector("[role=dialog]")');
}
+ // Restore the viewport after narrow-layout checks so earlier feedback
+ // cannot cover the toolbar and intercept the error-path clicks.
+ win.setContentSize(1100, 800);
+ await wait('innerWidth === 1100 && innerHeight === 800');
await evaluate('Object.defineProperty(navigator, "clipboard", {configurable:true,value:{writeText:async()=>{throw Error("denied")}}})');
await click('button[aria-label="复制表格为 Markdown"]');
await wait('window.tableFixture.toast()?.message === "无法复制表格"');