From 5d6c16e97237ca08778291a11695faff9b2e5963 Mon Sep 17 00:00:00 2001 From: xxxigm Date: Fri, 12 Jun 2026 18:27:14 +0700 Subject: [PATCH] test(desktop): cover the inline command expander on the approval bar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Asserts the full command is absent until the Command toggle is clicked, then rendered in full — guarding the long-command reveal path. --- .../components/assistant-ui/tool-approval.test.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/desktop/src/components/assistant-ui/tool-approval.test.tsx b/apps/desktop/src/components/assistant-ui/tool-approval.test.tsx index 0d13371afee..007eeff831b 100644 --- a/apps/desktop/src/components/assistant-ui/tool-approval.test.tsx +++ b/apps/desktop/src/components/assistant-ui/tool-approval.test.tsx @@ -84,6 +84,19 @@ describe('PendingToolApproval', () => { expect($approvalRequest.get()).toBeNull() }) + it('reveals the full command inline when the Command toggle is clicked', () => { + const longCommand = 'python -c "' + 'x'.repeat(400) + '"' + setRequest(longCommand) + render() + + // Collapsed by default: the full command is not in the DOM yet. + expect(screen.queryByText(longCommand)).toBeNull() + + fireEvent.click(screen.getByRole('button', { name: /Command/ })) + + expect(screen.getByText(longCommand)).toBeTruthy() + }) + it('sends choice "deny" on Reject', async () => { const request = mockGateway() setRequest()