@@ -15,10 +15,9 @@ final class StatusBarTextTests: XCTestCase {
15 balance: 42, isLoading: false,
15 balance: 42, isLoading: false,
16 hyperConfigured: true,
16 hyperConfigured: true,
17 claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
17 claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
18− zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
18+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
19− zaiInPeakHours: false
21− XCTAssertEqual(title, "⚡42 · \u{2055}62% 8%")
20+ XCTAssertEqual(title, "⚡42 · \u{1F172}62% 8%")
24 func testHyperOnly() {
23 func testHyperOnly() {
@@ -26,8 +25,7 @@ final class StatusBarTextTests: XCTestCase {
26 balance: 42, isLoading: false,
25 balance: 42, isLoading: false,
27 hyperConfigured: true,
26 hyperConfigured: true,
28 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
27 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
29− zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
28+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
30− zaiInPeakHours: false
32 XCTAssertEqual(title, "⚡42")
30 XCTAssertEqual(title, "⚡42")
@@ -37,10 +35,9 @@ final class StatusBarTextTests: XCTestCase {
37 balance: nil, isLoading: false,
35 balance: nil, isLoading: false,
38 hyperConfigured: false,
36 hyperConfigured: false,
39 claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
37 claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
40− zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
38+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
41− zaiInPeakHours: false
43− XCTAssertEqual(title, "\u{2055}62% 8%")
40+ XCTAssertEqual(title, "\u{1F172}62% 8%")
46 func testLoadingWithNothingToShow() {
43 func testLoadingWithNothingToShow() {
@@ -48,8 +45,7 @@ final class StatusBarTextTests: XCTestCase {
48 balance: nil, isLoading: true,
45 balance: nil, isLoading: true,
49 hyperConfigured: false,
46 hyperConfigured: false,
50 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
47 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
51− zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
48+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
52− zaiInPeakHours: false
54 XCTAssertEqual(title, "…")
50 XCTAssertEqual(title, "…")
@@ -59,8 +55,7 @@ final class StatusBarTextTests: XCTestCase {
59 balance: nil, isLoading: false,
55 balance: nil, isLoading: false,
60 hyperConfigured: false,
56 hyperConfigured: false,
61 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
57 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
62− zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
58+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
63− zaiInPeakHours: false
65 XCTAssertEqual(title, "")
60 XCTAssertEqual(title, "")
@@ -73,10 +68,9 @@ final class StatusBarTextTests: XCTestCase {
73 balance: nil, isLoading: true,
68 balance: nil, isLoading: true,
74 hyperConfigured: false,
69 hyperConfigured: false,
75 claudeFiveHourPercent: 62, claudeSevenDayPercent: nil,
70 claudeFiveHourPercent: 62, claudeSevenDayPercent: nil,
76− zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
71+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
77− zaiInPeakHours: false
79− XCTAssertEqual(title, "\u{2055}62%")
73+ XCTAssertEqual(title, "\u{1F172}62%")
82 func testLoadingKeepsAStaleBalanceOnScreen() {
76 func testLoadingKeepsAStaleBalanceOnScreen() {
@@ -84,21 +78,19 @@ final class StatusBarTextTests: XCTestCase {
84 balance: 42, isLoading: true,
78 balance: 42, isLoading: true,
85 hyperConfigured: true,
79 hyperConfigured: true,
86 claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
80 claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
87− zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
81+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
88− zaiInPeakHours: false
90− XCTAssertEqual(title, "⚡42 · \u{2055}62% 8%")
83+ XCTAssertEqual(title, "⚡42 · \u{1F172}62% 8%")
93− func testZeroPercentIsShown() {
86+ func testZeroPercentIsShownRatherThanOmitted() {
94 let title = ViewModel.statusBarText(
87 let title = ViewModel.statusBarText(
95 balance: 42, isLoading: false,
88 balance: 42, isLoading: false,
96 hyperConfigured: true,
89 hyperConfigured: true,
97 claudeFiveHourPercent: 0, claudeSevenDayPercent: 8,
90 claudeFiveHourPercent: 0, claudeSevenDayPercent: 8,
98− zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
91+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
99− zaiInPeakHours: false
101− XCTAssertEqual(title, "⚡42 · \u{2055}0% 8%")
93+ XCTAssertEqual(title, "⚡42 · \u{1F172}8%")
104 func testBothClaudeWindowsZero() {
96 func testBothClaudeWindowsZero() {
@@ -106,10 +98,9 @@ final class StatusBarTextTests: XCTestCase {
106 balance: 42, isLoading: false,
98 balance: 42, isLoading: false,
107 hyperConfigured: true,
99 hyperConfigured: true,
108 claudeFiveHourPercent: 0, claudeSevenDayPercent: 0,
100 claudeFiveHourPercent: 0, claudeSevenDayPercent: 0,
109− zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
101+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
110− zaiInPeakHours: false
112− XCTAssertEqual(title, "⚡42 · \u{2055}0% 0%")
103+ XCTAssertEqual(title, "⚡42")
115 func testFiveHourOnly() {
106 func testFiveHourOnly() {
@@ -117,10 +108,9 @@ final class StatusBarTextTests: XCTestCase {
117 balance: nil, isLoading: false,
108 balance: nil, isLoading: false,
118 hyperConfigured: false,
109 hyperConfigured: false,
119 claudeFiveHourPercent: 62, claudeSevenDayPercent: nil,
110 claudeFiveHourPercent: 62, claudeSevenDayPercent: nil,
120− zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
111+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
121− zaiInPeakHours: false
123− XCTAssertEqual(title, "\u{2055}62%")
113+ XCTAssertEqual(title, "\u{1F172}62%")
126 func testSevenDayOnly() {
116 func testSevenDayOnly() {
@@ -128,10 +118,9 @@ final class StatusBarTextTests: XCTestCase {
128 balance: nil, isLoading: false,
118 balance: nil, isLoading: false,
129 hyperConfigured: false,
119 hyperConfigured: false,
130 claudeFiveHourPercent: nil, claudeSevenDayPercent: 8,
120 claudeFiveHourPercent: nil, claudeSevenDayPercent: 8,
131− zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
121+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
132− zaiInPeakHours: false
134− XCTAssertEqual(title, "\u{2055}8%")
123+ XCTAssertEqual(title, "\u{1F172}8%")
137 // MARK: - Hyper not configured
126 // MARK: - Hyper not configured
@@ -143,8 +132,7 @@ final class StatusBarTextTests: XCTestCase {
143 balance: 42, isLoading: false,
132 balance: 42, isLoading: false,
144 hyperConfigured: false,
133 hyperConfigured: false,
145 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
134 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
146− zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
135+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
147− zaiInPeakHours: false
149 XCTAssertEqual(title, "")
137 XCTAssertEqual(title, "")
@@ -154,8 +142,7 @@ final class StatusBarTextTests: XCTestCase {
154 balance: nil, isLoading: true,
142 balance: nil, isLoading: true,
155 hyperConfigured: false,
143 hyperConfigured: false,
156 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
144 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
157− zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
145+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
158− zaiInPeakHours: false
160 XCTAssertEqual(title, "…")
147 XCTAssertEqual(title, "…")
@@ -165,10 +152,9 @@ final class StatusBarTextTests: XCTestCase {
165 balance: nil, isLoading: false,
152 balance: nil, isLoading: false,
166 hyperConfigured: false,
153 hyperConfigured: false,
167 claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
154 claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
168− zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
155+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
169− zaiInPeakHours: false
171− XCTAssertEqual(title, "\u{2055}62% 8%")
157+ XCTAssertEqual(title, "\u{1F172}62% 8%")
174 // MARK: - z.ai in Title
160 // MARK: - z.ai in Title
@@ -178,10 +164,9 @@ final class StatusBarTextTests: XCTestCase {
178 balance: nil, isLoading: false,
164 balance: nil, isLoading: false,
179 hyperConfigured: false,
165 hyperConfigured: false,
180 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
166 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
181− zaiFiveHourPercent: 12, zaiWeeklyPercent: nil,
167+ zaiFiveHourPercent: 12, zaiWeeklyPercent: nil
182− zaiInPeakHours: false
184− XCTAssertEqual(title, "\u{005A}12%")
169+ XCTAssertEqual(title, "\u{1F169}12%")
187 func testZaiWithHyper() {
172 func testZaiWithHyper() {
@@ -189,10 +174,9 @@ final class StatusBarTextTests: XCTestCase {
189 balance: 42, isLoading: false,
174 balance: 42, isLoading: false,
190 hyperConfigured: true,
175 hyperConfigured: true,
191 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
176 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
192− zaiFiveHourPercent: 12, zaiWeeklyPercent: nil,
177+ zaiFiveHourPercent: 12, zaiWeeklyPercent: nil
193− zaiInPeakHours: false
195− XCTAssertEqual(title, "⚡42 · \u{005A}12%")
179+ XCTAssertEqual(title, "⚡42 · \u{1F169}12%")
198 func testZaiWithClaude() {
182 func testZaiWithClaude() {
@@ -200,10 +184,9 @@ final class StatusBarTextTests: XCTestCase {
200 balance: nil, isLoading: false,
184 balance: nil, isLoading: false,
201 hyperConfigured: false,
185 hyperConfigured: false,
202 claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
186 claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
203− zaiFiveHourPercent: 12, zaiWeeklyPercent: nil,
187+ zaiFiveHourPercent: 12, zaiWeeklyPercent: nil
204− zaiInPeakHours: false
206− XCTAssertEqual(title, "\u{2055}62% 8% · \u{005A}12%")
189+ XCTAssertEqual(title, "\u{1F172}62% 8% · \u{1F169}12%")
209 func testAllThreeServices() {
192 func testAllThreeServices() {
@@ -211,21 +194,19 @@ final class StatusBarTextTests: XCTestCase {
211 balance: 42, isLoading: false,
194 balance: 42, isLoading: false,
212 hyperConfigured: true,
195 hyperConfigured: true,
213 claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
196 claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
214− zaiFiveHourPercent: 12, zaiWeeklyPercent: 3,
197+ zaiFiveHourPercent: 12, zaiWeeklyPercent: 3
215− zaiInPeakHours: false
217− XCTAssertEqual(title, "⚡42 · \u{2055}62% 8% · \u{005A}12% 3%")
199+ XCTAssertEqual(title, "⚡42 · \u{1F172}62% 8% · \u{1F169}12% 3%")
220− func testZaiZeroIsShown() {
202+ func testZaiZeroIsOmitted() {
221 let title = ViewModel.statusBarText(
203 let title = ViewModel.statusBarText(
222 balance: 42, isLoading: false,
204 balance: 42, isLoading: false,
223 hyperConfigured: true,
205 hyperConfigured: true,
224 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
206 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
225− zaiFiveHourPercent: 0, zaiWeeklyPercent: 0,
207+ zaiFiveHourPercent: 0, zaiWeeklyPercent: 0
226− zaiInPeakHours: false
228− XCTAssertEqual(title, "⚡42 · \u{005A}0% 0%")
209+ XCTAssertEqual(title, "⚡42")
231 func testLoadingKeepsZaiPercentOnScreen() {
212 func testLoadingKeepsZaiPercentOnScreen() {
@@ -233,10 +214,9 @@ final class StatusBarTextTests: XCTestCase {
233 balance: nil, isLoading: true,
214 balance: nil, isLoading: true,
234 hyperConfigured: false,
215 hyperConfigured: false,
235 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
216 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
236− zaiFiveHourPercent: 12, zaiWeeklyPercent: nil,
217+ zaiFiveHourPercent: 12, zaiWeeklyPercent: nil
237− zaiInPeakHours: false
239− XCTAssertEqual(title, "\u{005A}12%")
219+ XCTAssertEqual(title, "\u{1F169}12%")
242 // MARK: - z.ai Weekly
222 // MARK: - z.ai Weekly
@@ -246,10 +226,9 @@ final class StatusBarTextTests: XCTestCase {
246 balance: nil, isLoading: false,
226 balance: nil, isLoading: false,
247 hyperConfigured: false,
227 hyperConfigured: false,
248 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
228 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
249− zaiFiveHourPercent: nil, zaiWeeklyPercent: 3,
229+ zaiFiveHourPercent: nil, zaiWeeklyPercent: 3
250− zaiInPeakHours: false
252− XCTAssertEqual(title, "\u{005A}3%")
231+ XCTAssertEqual(title, "\u{1F169}3%")
255 func testZaiWeeklyWithFiveHour() {
234 func testZaiWeeklyWithFiveHour() {
@@ -257,21 +236,19 @@ final class StatusBarTextTests: XCTestCase {
257 balance: nil, isLoading: false,
236 balance: nil, isLoading: false,
258 hyperConfigured: false,
237 hyperConfigured: false,
259 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
238 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
260− zaiFiveHourPercent: 12, zaiWeeklyPercent: 3,
239+ zaiFiveHourPercent: 12, zaiWeeklyPercent: 3
261− zaiInPeakHours: false
263− XCTAssertEqual(title, "\u{005A}12% 3%")
241+ XCTAssertEqual(title, "\u{1F169}12% 3%")
266− func testZaiWeeklyZeroIsShown() {
244+ func testZaiWeeklyZeroIsOmitted() {
267 let title = ViewModel.statusBarText(
245 let title = ViewModel.statusBarText(
268 balance: nil, isLoading: false,
246 balance: nil, isLoading: false,
269 hyperConfigured: false,
247 hyperConfigured: false,
270 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
248 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
271− zaiFiveHourPercent: 12, zaiWeeklyPercent: 0,
249+ zaiFiveHourPercent: 12, zaiWeeklyPercent: 0
272− zaiInPeakHours: false
274− XCTAssertEqual(title, "\u{005A}12% 0%")
251+ XCTAssertEqual(title, "\u{1F169}12%")
277 func testLoadingKeepsZaiWeeklyOnScreen() {
254 func testLoadingKeepsZaiWeeklyOnScreen() {
@@ -279,46 +256,9 @@ final class StatusBarTextTests: XCTestCase {
279 balance: nil, isLoading: true,
256 balance: nil, isLoading: true,
280 hyperConfigured: false,
257 hyperConfigured: false,
281 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
258 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
282− zaiFiveHourPercent: nil, zaiWeeklyPercent: 3,
259+ zaiFiveHourPercent: nil, zaiWeeklyPercent: 3
283− zaiInPeakHours: false
285− XCTAssertEqual(title, "\u{005A}3%")
288− // MARK: - z.ai Peak Hours
290− func testPeakHoursAddsDiamondToZaiSegment() {
291− let title = ViewModel.statusBarText(
292− balance: 42, isLoading: false,
293− hyperConfigured: true,
294− claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
295− zaiFiveHourPercent: 12, zaiWeeklyPercent: 3,
296− zaiInPeakHours: true
298− XCTAssertEqual(title, "⚡42 · \u{2055}62% 8% · \u{005A}12% 3%\u{1F536}")
301− func testPeakHoursWithZaiOnly() {
302− let title = ViewModel.statusBarText(
303− balance: nil, isLoading: false,
304− hyperConfigured: false,
305− claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
306− zaiFiveHourPercent: 12, zaiWeeklyPercent: nil,
307− zaiInPeakHours: true
309− XCTAssertEqual(title, "\u{005A}12%\u{1F536}")
312− func testPeakHoursIgnoredWhenZaiNotConfigured() {
313− let title = ViewModel.statusBarText(
314− balance: 42, isLoading: false,
315− hyperConfigured: true,
316− claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
317− zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
318− zaiInPeakHours: true
320− // No z.ai segment, so peak marker has nothing to attach to.
321− XCTAssertEqual(title, "⚡42 · \u{2055}62% 8%")
261+ XCTAssertEqual(title, "\u{1F169}3%")
324 // MARK: - Claude Window Percentages
264 // MARK: - Claude Window Percentages