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

@@ -67,7 +67,7 @@ struct SportTests {
@Test("MLB: isInSeason returns true for months 3-10")
func mlb_isInSeason_normalRange() {
let calendar = Calendar.current
let calendar = TestClock.calendar
// In season: March through October
for month in 3...10 {
@@ -86,7 +86,7 @@ struct SportTests {
@Test("NBA: isInSeason returns true for months 10-12 and 1-6 (wrap-around)")
func nba_isInSeason_wrapAround() {
let calendar = Calendar.current
let calendar = TestClock.calendar
// In season: October through June (wraps)
let inSeasonMonths = [10, 11, 12, 1, 2, 3, 4, 5, 6]
@@ -104,7 +104,7 @@ struct SportTests {
@Test("NFL: isInSeason returns true for months 9-12 and 1-2 (wrap-around)")
func nfl_isInSeason_wrapAround() {
let calendar = Calendar.current
let calendar = TestClock.calendar
// In season: September through February (wraps)
let inSeasonMonths = [9, 10, 11, 12, 1, 2]
@@ -124,7 +124,7 @@ struct SportTests {
@Test("isInSeason boundary: first and last day of season month")
func isInSeason_boundaryDays() {
let calendar = Calendar.current
let calendar = TestClock.calendar
// MLB: First day of March (in season)
let marchFirst = calendar.date(from: DateComponents(year: 2026, month: 3, day: 1))!