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,8 +22,8 @@ struct SuggestedTripTests {
preferences: TripPreferences(
planningMode: .dateRange,
sports: [.mlb],
startDate: Date(),
endDate: Date().addingTimeInterval(86400 * 7),
startDate: TestClock.now,
endDate: TestClock.now.addingTimeInterval(86400 * 7),
leisureLevel: .moderate
),
stops: [],
@@ -339,7 +339,7 @@ struct CrossCountryFeatureTripTests {
idPrefix: String
) -> [Game] {
var games: [Game] = []
let calendar = Calendar.current
let calendar = TestClock.calendar
for (index, stadium) in stadiums.enumerated() {
let gameDate = calendar.date(byAdding: .day, value: index * spacingDays, to: startDate) ?? startDate
@@ -373,7 +373,7 @@ struct CrossCountryFeatureTripTests {
idPrefix: "e2w"
)
let secondLegStart = Calendar.current.date(
let secondLegStart = TestClock.calendar.date(
byAdding: .day,
value: (sortedEastToWest.count * spacingDays) + 2,
to: baseDate