Skip to content

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

test(e2e): align transcript probes with nested disclosure

vastsa611e4b7fbe4e
diff --git a/scripts/e2e/transcript-disclosure-anchor.tsx b/scripts/e2e/transcript-disclosure-anchor.tsx
index ee2bb5bdd..f57f15ce7 100644
--- a/scripts/e2e/transcript-disclosure-anchor.tsx
+++ b/scripts/e2e/transcript-disclosure-anchor.tsx
@@ -277,19 +277,34 @@ globalThis.transcriptDisclosureProbe = async () => {
assert(processScroller && processTitle, "process fixture did not render");
await settle();
const processBefore = geometry(processScroller, processTitle);
+ assert(
+ processTitle.getAttribute("aria-expanded") === "true",
+ "detailed should start the process open",
+ );
processTitle.click();
await settle();
- const processExpanded = geometry(processScroller, processTitle);
- assert(processExpanded.scrollHeight > processBefore.scrollHeight + 100, "process did not expand");
- assert(Math.abs(processExpanded.titleTop - processBefore.titleTop) < 2, "process expansion moved its title");
+ const processCollapsed = geometry(processScroller, processTitle);
+ assert(
+ processCollapsed.scrollHeight < processBefore.scrollHeight - 100,
+ "process did not collapse",
+ );
processTitle.click();
await settle();
- const processCollapsed = geometry(processScroller, processTitle);
- assert(Math.abs(processCollapsed.titleTop - processBefore.titleTop) < 2, "process collapse moved its title");
+ const processExpanded = geometry(processScroller, processTitle);
+ assert(
+ processExpanded.scrollHeight > processCollapsed.scrollHeight + 100,
+ "process did not expand",
+ );
+ // Expansion grows content under a pinned bottom, which is the case the held
+ // anchor has to compensate; the collapse above may legitimately clamp.
+ assert(
+ Math.abs(processExpanded.titleTop - processCollapsed.titleTop) < 2,
+ "process expansion moved its title",
+ );
assert(renderErrors.length === 0, `React render errors: ${renderErrors.map(String).join("; ")}`);
return {
ok: true,
- process: { before: processBefore, expanded: processExpanded, collapsed: processCollapsed },
+ process: { before: processBefore, collapsed: processCollapsed, expanded: processExpanded },
transcript: { before, expanded, collapsed },
dock: { before: dockBefore, expanded: dockExpanded },
};
diff --git a/scripts/e2e/turn-process.tsx b/scripts/e2e/turn-process.tsx
index ede3c9484..ca3facb33 100644
--- a/scripts/e2e/turn-process.tsx
+++ b/scripts/e2e/turn-process.tsx
@@ -111,8 +111,12 @@ export async function turnProcessProbe() {
try {
render(messages);
check(
- container.querySelectorAll(".turn-process").length === 0,
- "detailed does not wrap a process",
+ container.querySelectorAll(".turn-process").length === 1,
+ "detailed wraps one process per turn",
+ );
+ check(
+ header()?.getAttribute("aria-expanded") === "true" && visible(process()),
+ "detailed starts the process open",
);
check(
visible(container.querySelector('[data-message-id="answer"]')),
@@ -155,7 +159,8 @@ export async function turnProcessProbe() {
);
render([streaming, read], true, null, "stream");
check(
- !header() && visible(container.querySelector('[data-message-id="stream"]')),
+ header()?.getAttribute("aria-expanded") === "true" &&
+ visible(container.querySelector('[data-message-id="stream"]')),
"detailed keeps streamed text visible after later tools",
);
render([intro, read, { ...answer, status: "aborted" }], false, null, "aborted");
@@ -199,7 +204,7 @@ export async function turnProcessProbe() {
"compact keeps tool payloads collapsed",
);
check(
- header()?.textContent?.includes("4 steps"),
+ header()?.textContent?.includes("2 tools"),
"process counts tools and progress once",
);
click(header());