Bedrock/Tests/BedrockTests/BedrockTests.swift
Matt Bruce fa7d848f52 Initial commit: Bedrock design system and UI component library
- Design system: spacing, typography, colors, animations, opacity, shadows
- Protocol-based color theming (AppColorTheme)
- Settings UI components: toggles, pickers, selection indicators
- Sound and haptic feedback manager (generic AppSound protocol)
- Onboarding state management
- Cloud sync manager (PersistableData protocol)
- Visual effects: ConfettiView, PulsingModifier
- Debug utilities: DebugBorderModifier
- Device information utilities (cross-platform)
- Unit tests for design constants
2026-01-02 11:58:30 -06:00

65 lines
2.1 KiB
Swift

//
// BedrockTests.swift
// Bedrock
//
// Unit tests for the Bedrock design system.
//
import XCTest
@testable import Bedrock
final class BedrockTests: XCTestCase {
// MARK: - Design Constants Tests
func testSpacingValuesArePositive() {
XCTAssertGreaterThan(Design.Spacing.xxxSmall, 0)
XCTAssertGreaterThan(Design.Spacing.small, 0)
XCTAssertGreaterThan(Design.Spacing.medium, 0)
XCTAssertGreaterThan(Design.Spacing.large, 0)
}
func testSpacingValuesAreOrdered() {
XCTAssertLessThan(Design.Spacing.xxxSmall, Design.Spacing.xxSmall)
XCTAssertLessThan(Design.Spacing.xxSmall, Design.Spacing.xSmall)
XCTAssertLessThan(Design.Spacing.xSmall, Design.Spacing.small)
XCTAssertLessThan(Design.Spacing.small, Design.Spacing.medium)
XCTAssertLessThan(Design.Spacing.medium, Design.Spacing.large)
XCTAssertLessThan(Design.Spacing.large, Design.Spacing.xLarge)
}
func testOpacityValuesAreInRange() {
XCTAssertGreaterThanOrEqual(Design.Opacity.verySubtle, 0)
XCTAssertLessThanOrEqual(Design.Opacity.almostFull, 1)
}
func testCornerRadiusValuesArePositive() {
XCTAssertGreaterThan(Design.CornerRadius.small, 0)
XCTAssertGreaterThan(Design.CornerRadius.medium, 0)
XCTAssertGreaterThan(Design.CornerRadius.large, 0)
}
func testAnimationDurationsArePositive() {
XCTAssertGreaterThan(Design.Animation.quick, 0)
XCTAssertGreaterThan(Design.Animation.standard, 0)
XCTAssertGreaterThan(Design.Animation.springDuration, 0)
}
func testFontSizesArePositive() {
XCTAssertGreaterThan(Design.BaseFontSize.small, 0)
XCTAssertGreaterThan(Design.BaseFontSize.body, 0)
XCTAssertGreaterThan(Design.BaseFontSize.title, 0)
}
func testMinimumTouchTargetMeetsHIG() {
// Apple HIG requires minimum 44pt touch targets
XCTAssertGreaterThanOrEqual(Design.HitTarget.minimum, 44)
}
// MARK: - Version Test
func testVersionIsNotEmpty() {
XCTAssertFalse(BedrockInfo.version.isEmpty)
}
}