Files
steipete--codexbar/Tests/CodexBarTests/UsageBreakdownChartMenuViewTests.swift
T
2026-07-13 12:22:33 +08:00

31 lines
876 B
Swift

import Testing
@testable import CodexBar
@Suite("Usage breakdown chart menu")
@MainActor
struct UsageBreakdownChartMenuViewTests {
@Test
func `valid totals remain visible when service rows are absent`() {
#expect(
UsageBreakdownChartMenuView.presentationState(
hasSummary: true,
hasChartPoints: false) == .totalsOnly)
}
@Test
func `service rows select the chart presentation`() {
#expect(
UsageBreakdownChartMenuView.presentationState(
hasSummary: true,
hasChartPoints: true) == .chart)
}
@Test
func `missing totals and service rows select the empty presentation`() {
#expect(
UsageBreakdownChartMenuView.presentationState(
hasSummary: false,
hasChartPoints: false) == .empty)
}
}