codeburn/mac/Tests/CodeBurnMenubarTests
ozymandiashh 805d2ffa49
Some checks are pending
CI / semgrep (push) Waiting to run
feat(menubar): add Local/Combined usage toggle (#566) (#568)
Mirror the combined multi-device dashboard in the macOS menubar via a
Local/Combined scope toggle (Settings -> Display). Builds on the menubar-json
`--scope combined` contract.

- MenubarScope enum (.local default) persisted in UserDefaults; PayloadCacheKey
  gains a scope dimension so local and combined payloads cache separately.
- DataClient.fetch(scope:): a pure statusSubcommand builder appends
  `--scope combined` only for combined, forces `--provider all` (the CLI rejects
  combined with a provider/project/exclude filter), and coerces multi-day
  selections to local (the CLI rejects combined + --days).
- MenubarPayload decodes the optional `combined` block (per-device + totals);
  nil when absent (back-compat).
- The badge always stays on the local payload; the combined network pull lives
  on a separate cache key and falls back to local with a "Combined unavailable"
  indicator, so a slow/offline peer never blocks the badge.
- Hero shows combined totals + a per-device breakdown in Combined scope; the
  token metric stays input+output (cache excluded) to match local; the
  per-device daily-budget warning is suppressed for a multi-device total;
  selecting Combined resets the provider tab to All.

Tests run via `swift test` (CommandLineTools Testing.framework on the rpath, no
Xcode): scope persistence, argv (local/combined/provider-forcing/multi-day),
cache-key partition, badge-survives-combined-failure, combined decode, token
consistency, provider reset, budget suppression.
2026-06-28 22:01:01 +02:00
..
AppStoreRefreshRecoveryTests.swift feat(menubar): add Local/Combined usage toggle (#566) (#568) 2026-06-28 22:01:01 +02:00
AppVersionTests.swift Normalize menubar version display 2026-05-11 11:21:39 -07:00
CapacityEstimatorTests.swift feat(mac): native Swift menubar app + one-command install 2026-04-17 16:55:56 -07:00
CLIDevinConfigTests.swift feat: add devin provider (#444) 2026-06-09 21:58:31 +02:00
CodexTerminalFailureTests.swift test(menubar): lock in Codex terminal-failure classification 2026-05-30 12:32:19 -07:00
ContributionHeatmapTests.swift fix(menubar-tests): add missing localModelSavings/savingsUSD args so swift tests compile (#465) 2026-06-09 21:56:13 +02:00
DataClientProcessTests.swift feat(menubar): add Local/Combined usage toggle (#566) (#568) 2026-06-28 22:01:01 +02:00
MenubarPayloadCombinedTests.swift feat(menubar): add Local/Combined usage toggle (#566) (#568) 2026-06-28 22:01:01 +02:00
MenubarPeriodSettingsTests.swift feat(menubar): add Local/Combined usage toggle (#566) (#568) 2026-06-28 22:01:01 +02:00
MenubarStatusCacheTests.swift feat(menubar): add Local/Combined usage toggle (#566) (#568) 2026-06-28 22:01:01 +02:00
UpdateCheckerTests.swift Harden menubar refresh and installer 2026-05-14 18:32:15 -07:00