mirror of
https://github.com/luckyyzh/pi-agent-integrated.git
synced 2026-10-03 02:59:35 +00:00
feat: integrate Pi backend and Pi Web
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import test from "node:test";
|
||||
|
||||
const source = await readFile(new URL("./SessionSidebar.tsx", import.meta.url), "utf8");
|
||||
const sessionItemSource = source.slice(source.indexOf("function SessionItem("));
|
||||
|
||||
test("only Shift+click bypasses session deletion confirmation", () => {
|
||||
assert.match(
|
||||
sessionItemSource,
|
||||
/const handleDeleteClick[\s\S]*?if \(e\.shiftKey\) \{\s*void performDelete\(\);\s*\} else \{\s*setConfirmDelete\(true\);/,
|
||||
);
|
||||
});
|
||||
|
||||
test("does not register row-level session deletion shortcuts", () => {
|
||||
assert.doesNotMatch(sessionItemSource, /const handleKeyDown/);
|
||||
assert.doesNotMatch(sessionItemSource, /onKeyDown=\{handleKeyDown\}/);
|
||||
assert.doesNotMatch(sessionItemSource, /tabIndex=\{0\}/);
|
||||
});
|
||||
Reference in New Issue
Block a user