|
1 | 1 | import { describe, expect, it } from "vite-plus/test"; |
2 | 2 |
|
3 | 3 | import { |
| 4 | + approvalCommandDisplayText, |
4 | 5 | commandDisplayText, |
5 | 6 | commandHighlightLanguage, |
6 | 7 | commandProgramName, |
@@ -498,6 +499,21 @@ describe("commandDisplayText", () => { |
498 | 499 | }); |
499 | 500 | }); |
500 | 501 |
|
| 502 | +describe("approvalCommandDisplayText", () => { |
| 503 | + it.each([ |
| 504 | + [ |
| 505 | + "/bin/bash -lc 'curl -sI https://example.com | head -n 1'", |
| 506 | + "curl -sI https://example.com | head -n 1", |
| 507 | + ], |
| 508 | + ["bash --rcfile /tmp/init.sh -ic 'git status'", "bash --rcfile /tmp/init.sh -ic 'git status'"], |
| 509 | + ["zsh -lc 'echo $1' name value", "zsh -lc 'echo $1' name value"], |
| 510 | + ["zsh -lc 'pwd'; rm -rf build", "zsh -lc 'pwd'; rm -rf build"], |
| 511 | + ["git status", "git status"], |
| 512 | + ])("unwraps only a bare shell wrapper: %s", (input, expected) => { |
| 513 | + expect(approvalCommandDisplayText(input)).toBe(expected); |
| 514 | + }); |
| 515 | +}); |
| 516 | + |
501 | 517 | describe("commands recorded from each provider", () => { |
502 | 518 | // Inputs are copied from the recorded replay transcripts in |
503 | 519 | // apps/server/src/orchestration-v2/testkit/fixtures (turn_interrupt_mid_tool, |
|
0 commit comments