Skip to content

Commit 77af91b

Browse files
axisrowclaude
andcommitted
fix: align tests and compact labels with merged upstream changes
Three merge fallouts after merging origin/main into the PR branch: - upstream-terminal-sanitize: upstream c08a59d drops an 8-bit C1 CSI sequence whole (terminals consume it as one unit), so \x9b2J no longer leaves 2J as text; expect 'okx'. - usage-prefetch: the fork's async providers pass a cache handle in every fetchUsageData call; the upstream spend-limit test now uses the same anyCacheMatcher() as the neighboring assertions. - compact labels: upstream 6e148cb renamed the session usage label from "Session:" to "5h:", so the compact-label probe dropped the widget; add the '5h: ' preset. Co-Authored-By: Claude Code <[email protected]>
1 parent ba4f2bc commit 77af91b

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎src/utils/__tests__/upstream-terminal-sanitize.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ describe('upstream 3d94211: terminal control sequences are sanitized', () => {
4141
customText: 'ok\x9b2Jx'
4242
};
4343

44-
expect(renderOne(widget)).toBe('ok2Jx');
44+
// Upstream c08a59d: the 8-bit CSI \x9b2J is a complete sequence
45+
// terminals consume whole, so it's dropped entirely.
46+
expect(renderOne(widget)).toBe('okx');
4547
});
4648

4749
it('consumes complete string sequences and charset escapes', () => {

‎src/utils/__tests__/usage-prefetch.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ describe('usage prefetch', () => {
650650

651651
expect(usageData?.spendLimitUsage).toBe(62.8);
652652
expect(usageData?.extraUsageUsed).toBe(1000);
653-
expect(mockFetchUsageData.mock.calls[0]).toEqual([{ requiredFields: ['extraUsageEnabled', 'extraUsageUsed'] }]);
653+
expect(mockFetchUsageData.mock.calls[0]).toEqual([{ requiredFields: ['extraUsageEnabled', 'extraUsageUsed'], cache: anyCacheMatcher() }]);
654654
});
655655
});
656656

‎src/widgets/shared/raw-or-labeled.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ export const COMPACT_LABELS: Record<string, string> = {
6464
'Cache Write: ': 'CW:',
6565
'Cache Hit: ': 'CH:',
6666
'Block: ': 'B:',
67+
// Upstream 6e148cb renamed the session usage label from "Session:" to
68+
// "5h:" to end its clash with the session cost widgets.
69+
'5h: ': '5h:',
6770
'Block ': 'B',
6871
'Reset: ': 'R:',
6972
'Reset ': 'R',

0 commit comments

Comments
 (0)