mirror of
https://github.com/luckyyzh/pi-agent-integrated.git
synced 2026-10-03 11:09:34 +00:00
20 lines
809 B
JavaScript
20 lines
809 B
JavaScript
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\}/);
|
|
});
|