// // TheNoiseClockTests.swift // TheNoiseClockTests // // Created by Matt Bruce on 9/7/25. // import Testing @testable import The_Noise_Clock import Foundation @MainActor struct TheNoiseClockTests { @Test func defaultAlarmSoundIsMP3() { #expect(AppConstants.SystemSounds.defaultSound.hasSuffix(".mp3")) } @Test func nextOccurrenceIsInFuture() { let oneMinuteAgo = Calendar.current.date(byAdding: .minute, value: -1, to: Date()) ?? Date() let next = oneMinuteAgo.nextOccurrence() #expect(next > Date()) #expect(next.timeIntervalSinceNow < 26 * 60 * 60) } @Test func clockStyleCodableRoundTripPreservesSettings() throws { let style = ClockStyle() style.showSeconds = true style.showDate = false style.keepAwake = true style.fontFamily = .avenir style.digitAnimationStyle = .glitch let data = try JSONEncoder().encode(style) let decoded = try JSONDecoder().decode(ClockStyle.self, from: data) #expect(decoded.showSeconds) #expect(decoded.showDate == false) #expect(decoded.keepAwake) #expect(decoded.fontFamily == .avenir) #expect(decoded.digitAnimationStyle == .glitch) } }