Stabilize unit and UI tests for SportsTime

This commit is contained in:
treyt
2026-02-18 13:00:15 -06:00
parent 1488be7c1f
commit 20ac1a7e59
49 changed files with 432 additions and 325 deletions

View File

@@ -22,7 +22,7 @@ struct ItineraryBuilderTests {
private let chicagoCoord = CLLocationCoordinate2D(latitude: 41.8827, longitude: -87.6233)
private let seattleCoord = CLLocationCoordinate2D(latitude: 47.5914, longitude: -122.3316)
private let calendar = Calendar.current
private let calendar = TestClock.calendar
// MARK: - Specification Tests: build()
@@ -203,7 +203,7 @@ struct ItineraryBuilderTests {
@Test("arrivalBeforeGameStart: sufficient time passes")
func arrivalBeforeGameStart_sufficientTime_passes() {
let now = Date()
let now = TestClock.now
let tomorrow = calendar.date(byAdding: .day, value: 1, to: now)!
let gameTime = calendar.date(bySettingHour: 19, minute: 0, second: 0, of: tomorrow)!
@@ -232,7 +232,7 @@ struct ItineraryBuilderTests {
@Test("arrivalBeforeGameStart: insufficient time fails")
func arrivalBeforeGameStart_insufficientTime_fails() {
let now = Date()
let now = TestClock.now
let gameTime = now.addingTimeInterval(2 * 3600) // Game in 2 hours
let stop1 = makeStop(
@@ -349,7 +349,7 @@ struct ItineraryBuilderTests {
private func makeStop(
city: String,
coordinate: CLLocationCoordinate2D?,
departureDate: Date = Date(),
departureDate: Date = TestClock.now,
firstGameStart: Date? = nil
) -> ItineraryStop {
ItineraryStop(