From 7a72d255d8effec1396170306cc6be57f598a6d8 Mon Sep 17 00:00:00 2001 From: Abhi <43648792+abhipatel12@users.noreply.github.com> Date: Wed, 11 Jun 2025 16:40:31 -0400 Subject: feat: Add exit UI w/ stats (#924) --- .../SessionSummaryDisplay.test.tsx.snap | 45 ++++++++++++++++++++ .../components/__snapshots__/Stats.test.tsx.snap | 49 ++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 packages/cli/src/ui/components/__snapshots__/SessionSummaryDisplay.test.tsx.snap create mode 100644 packages/cli/src/ui/components/__snapshots__/Stats.test.tsx.snap (limited to 'packages/cli/src/ui/components/__snapshots__') diff --git a/packages/cli/src/ui/components/__snapshots__/SessionSummaryDisplay.test.tsx.snap b/packages/cli/src/ui/components/__snapshots__/SessionSummaryDisplay.test.tsx.snap new file mode 100644 index 00000000..74b067b7 --- /dev/null +++ b/packages/cli/src/ui/components/__snapshots__/SessionSummaryDisplay.test.tsx.snap @@ -0,0 +1,45 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[` > renders correctly with given stats and duration 1`] = ` +"╭─────────────────────────────────────╮ +│ │ +│ Agent powering down. Goodbye! │ +│ │ +│ │ +│ Cumulative Stats (10 Turns) │ +│ │ +│ Input Tokens 1,000 │ +│ Output Tokens 2,000 │ +│ Tool Use Tokens 200 │ +│ Thoughts Tokens 300 │ +│ Cached Tokens 500 (14.3%) │ +│ ───────────────────────────────── │ +│ Total Tokens 3,500 │ +│ │ +│ Total duration (API) 50.2s │ +│ Total duration (wall) 1h 23m 45s │ +│ │ +╰─────────────────────────────────────╯" +`; + +exports[` > renders zero state correctly 1`] = ` +"╭─────────────────────────────────╮ +│ │ +│ Agent powering down. Goodbye! │ +│ │ +│ │ +│ Cumulative Stats (0 Turns) │ +│ │ +│ Input Tokens 0 │ +│ Output Tokens 0 │ +│ Tool Use Tokens 0 │ +│ Thoughts Tokens 0 │ +│ Cached Tokens 0 │ +│ ────────────────────────── │ +│ Total Tokens 0 │ +│ │ +│ Total duration (API) 0s │ +│ Total duration (wall) 0s │ +│ │ +╰─────────────────────────────────╯" +`; diff --git a/packages/cli/src/ui/components/__snapshots__/Stats.test.tsx.snap b/packages/cli/src/ui/components/__snapshots__/Stats.test.tsx.snap new file mode 100644 index 00000000..9b003891 --- /dev/null +++ b/packages/cli/src/ui/components/__snapshots__/Stats.test.tsx.snap @@ -0,0 +1,49 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[` > renders a duration column 1`] = ` +"Duration + +API Time 5s +Wall Time 10s" +`; + +exports[` > renders a label and value 1`] = `"Test Label Test Value"`; + +exports[` > renders with a specific value color 1`] = `"Test Label Test Value"`; + +exports[` > renders a cumulative stats column with percentages 1`] = ` +"Cumulative Stats + +Input Tokens 100 +Output Tokens 200 +Tool Use Tokens 50 +Thoughts Tokens 25 +Cached Tokens 10 (2.6%) +──────────────────────────────────────────────────────────────────────────────────────────────────── +Total Tokens 385" +`; + +exports[` > renders a stats column with a specific width 1`] = ` +"Test Stats + +Input Tokens 100 +Output Tokens 200 +Tool Use Tokens 50 +Thoughts Tokens 25 +Cached Tokens 10 +────────────────────────────────────────────────── +Total Tokens 385" +`; + +exports[` > renders a stats column with children 1`] = ` +"Test Stats + +Input Tokens 100 +Output Tokens 200 +Tool Use Tokens 50 +Thoughts Tokens 25 +Cached Tokens 10 +──────────────────────────────────────────────────────────────────────────────────────────────────── +Total Tokens 385 +Child Prop Child Value" +`; -- cgit v1.2.3