Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

test: restore conditional-expect lint in ACP initialization (#10947)

Shahmir Varqha1f8b6f823741
diff --git a/frontend/src/components/chat/acp/__tests__/agent-panel-initialization.test.tsx b/frontend/src/components/chat/acp/__tests__/agent-panel-initialization.test.tsx
index 97f906b77a..21b7c5c6c0 100644
--- a/frontend/src/components/chat/acp/__tests__/agent-panel-initialization.test.tsx
+++ b/frontend/src/components/chat/acp/__tests__/agent-panel-initialization.test.tsx
@@ -155,21 +155,32 @@ describe("AgentPanel initialization", () => {
await act(async () => initialization.resolve(initialized));
expect(agent.authenticate).not.toHaveBeenCalled();
- if (sessionId) {
- expect(agent.loadSession).toHaveBeenCalledExactlyOnceWith({
- sessionId,
- cwd: "/notebooks",
- mcpServers: [],
- });
- expect(agent.newSession).not.toHaveBeenCalled();
- } else {
- expect(agent.newSession).toHaveBeenCalledExactlyOnceWith({
- cwd: "/notebooks",
- mcpServers: [],
- _meta: undefined,
- });
- expect(agent.loadSession).not.toHaveBeenCalled();
- }
+ expect(agent.loadSession.mock.calls).toEqual(
+ sessionId
+ ? [
+ [
+ {
+ sessionId,
+ cwd: "/notebooks",
+ mcpServers: [],
+ },
+ ],
+ ]
+ : [],
+ );
+ expect(agent.newSession.mock.calls).toStrictEqual(
+ sessionId
+ ? []
+ : [
+ [
+ {
+ cwd: "/notebooks",
+ mcpServers: [],
+ _meta: undefined,
+ },
+ ],
+ ],
+ );
expect(
screen.getByRole("button", { name: "Restart" }),
).toBeInTheDocument();