summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/components/__snapshots__/StatsDisplay.test.tsx.snap
blob: c7c2ec59c947f86a7ff3aee958bd7e585d97a19b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`<StatsDisplay /> > Conditional Color Tests > renders success rate in green for high values 1`] = `
"╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                  │
│  Session Stats                                                                                   │
│                                                                                                  │
│  Interaction Summary                                                                             │
│  Tool Calls:                 10 ( ✔ 10 ✖ 0 )                                                     │
│  Success Rate:               100.0%                                                              │
│                                                                                                  │
│  Performance                                                                                     │
│  Wall Time:                  1s                                                                  │
│  Agent Active:               0s                                                                  │
│    » API Time:               0s (0.0%)                                                           │
│    » Tool Time:              0s (0.0%)                                                           │
│                                                                                                  │
│                                                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
`;

exports[`<StatsDisplay /> > Conditional Color Tests > renders success rate in red for low values 1`] = `
"╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                  │
│  Session Stats                                                                                   │
│                                                                                                  │
│  Interaction Summary                                                                             │
│  Tool Calls:                 10 ( ✔ 5 ✖ 5 )                                                      │
│  Success Rate:               50.0%                                                               │
│                                                                                                  │
│  Performance                                                                                     │
│  Wall Time:                  1s                                                                  │
│  Agent Active:               0s                                                                  │
│    » API Time:               0s (0.0%)                                                           │
│    » Tool Time:              0s (0.0%)                                                           │
│                                                                                                  │
│                                                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
`;

exports[`<StatsDisplay /> > Conditional Color Tests > renders success rate in yellow for medium values 1`] = `
"╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                  │
│  Session Stats                                                                                   │
│                                                                                                  │
│  Interaction Summary                                                                             │
│  Tool Calls:                 10 ( ✔ 9 ✖ 1 )                                                      │
│  Success Rate:               90.0%                                                               │
│                                                                                                  │
│  Performance                                                                                     │
│  Wall Time:                  1s                                                                  │
│  Agent Active:               0s                                                                  │
│    » API Time:               0s (0.0%)                                                           │
│    » Tool Time:              0s (0.0%)                                                           │
│                                                                                                  │
│                                                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
`;

exports[`<StatsDisplay /> > Conditional Rendering Tests > hides Efficiency section when cache is not used 1`] = `
"╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                  │
│  Session Stats                                                                                   │
│                                                                                                  │
│  Performance                                                                                     │
│  Wall Time:                  1s                                                                  │
│  Agent Active:               100ms                                                               │
│    » API Time:               100ms (100.0%)                                                      │
│    » Tool Time:              0s (0.0%)                                                           │
│                                                                                                  │
│                                                                                                  │
│  Model Usage                  Reqs   Input Tokens  Output Tokens                                 │
│  ───────────────────────────────────────────────────────────────                                 │
│  gemini-2.5-pro                  1            100            100                                 │
│                                                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
`;

exports[`<StatsDisplay /> > Conditional Rendering Tests > hides User Agreement when no decisions are made 1`] = `
"╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                  │
│  Session Stats                                                                                   │
│                                                                                                  │
│  Interaction Summary                                                                             │
│  Tool Calls:                 2 ( ✔ 1 ✖ 1 )                                                       │
│  Success Rate:               50.0%                                                               │
│                                                                                                  │
│  Performance                                                                                     │
│  Wall Time:                  1s                                                                  │
│  Agent Active:               123ms                                                               │
│    » API Time:               0s (0.0%)                                                           │
│    » Tool Time:              123ms (100.0%)                                                      │
│                                                                                                  │
│                                                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
`;

exports[`<StatsDisplay /> > Title Rendering > renders the custom title when a title prop is provided 1`] = `
"╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                  │
│  Agent powering down. Goodbye!                                                                   │
│                                                                                                  │
│  Performance                                                                                     │
│  Wall Time:                  1s                                                                  │
│  Agent Active:               0s                                                                  │
│    » API Time:               0s (0.0%)                                                           │
│    » Tool Time:              0s (0.0%)                                                           │
│                                                                                                  │
│                                                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
`;

exports[`<StatsDisplay /> > Title Rendering > renders the default title when no title prop is provided 1`] = `
"╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                  │
│  Session Stats                                                                                   │
│                                                                                                  │
│  Performance                                                                                     │
│  Wall Time:                  1s                                                                  │
│  Agent Active:               0s                                                                  │
│    » API Time:               0s (0.0%)                                                           │
│    » Tool Time:              0s (0.0%)                                                           │
│                                                                                                  │
│                                                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
`;

exports[`<StatsDisplay /> > renders a table with two models correctly 1`] = `
"╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                  │
│  Session Stats                                                                                   │
│                                                                                                  │
│  Performance                                                                                     │
│  Wall Time:                  1s                                                                  │
│  Agent Active:               19.5s                                                               │
│    » API Time:               19.5s (100.0%)                                                      │
│    » Tool Time:              0s (0.0%)                                                           │
│                                                                                                  │
│                                                                                                  │
│  Model Usage                  Reqs   Input Tokens  Output Tokens                                 │
│  ───────────────────────────────────────────────────────────────                                 │
│  gemini-2.5-pro                  3          1,000          2,000                                 │
│  gemini-2.5-flash                5         25,000         15,000                                 │
│                                                                                                  │
│  Savings Highlight: 10,500 (40.4%) of input tokens were served from the cache, reducing costs.   │
│                                                                                                  │
│  » Tip: For a full token breakdown, run \`/stats model\`.                                          │
│                                                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
`;

exports[`<StatsDisplay /> > renders all sections when all data is present 1`] = `
"╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                  │
│  Session Stats                                                                                   │
│                                                                                                  │
│  Interaction Summary                                                                             │
│  Tool Calls:                 2 ( ✔ 1 ✖ 1 )                                                       │
│  Success Rate:               50.0%                                                               │
│  User Agreement:             100.0% (1 reviewed)                                                 │
│                                                                                                  │
│  Performance                                                                                     │
│  Wall Time:                  1s                                                                  │
│  Agent Active:               223ms                                                               │
│    » API Time:               100ms (44.8%)                                                       │
│    » Tool Time:              123ms (55.2%)                                                       │
│                                                                                                  │
│                                                                                                  │
│  Model Usage                  Reqs   Input Tokens  Output Tokens                                 │
│  ───────────────────────────────────────────────────────────────                                 │
│  gemini-2.5-pro                  1            100            100                                 │
│                                                                                                  │
│  Savings Highlight: 50 (50.0%) of input tokens were served from the cache, reducing costs.       │
│                                                                                                  │
│  » Tip: For a full token breakdown, run \`/stats model\`.                                          │
│                                                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
`;

exports[`<StatsDisplay /> > renders only the Performance section in its zero state 1`] = `
"╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                  │
│  Session Stats                                                                                   │
│                                                                                                  │
│  Performance                                                                                     │
│  Wall Time:                  1s                                                                  │
│  Agent Active:               0s                                                                  │
│    » API Time:               0s (0.0%)                                                           │
│    » Tool Time:              0s (0.0%)                                                           │
│                                                                                                  │
│                                                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
`;