Prepara iOS 2.0.13 build 37 per lo Store con icona chiara e test del calendario.
Apple ha chiuso il treno 2.0.12: servono versione nuova, monogramma visibile sul nero e copertura dei casi dopo l'orario previsto. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
2e67e590d6
commit
db0e842ca7
@@ -1,7 +1,45 @@
|
||||
import XCTest
|
||||
@testable import MatchLiveTv
|
||||
|
||||
/// Smoke test eseguibile senza @testable import (validazione logica pura).
|
||||
/// Logica calendario/API reale + smoke parser (RTMP/overlay) senza dipendenze di rete.
|
||||
final class ApiInstantTests: XCTestCase {
|
||||
func testParseApiInstantRailsOffsetWithMillis() {
|
||||
let now = iso("2026-06-06T16:00:00Z")
|
||||
XCTAssertTrue(ApiInstant.isScheduledOnCalendar("2026-06-06T20:00:00.000+02:00", now: now))
|
||||
}
|
||||
|
||||
func testIsScheduledOnCalendarKeepsThisMorningAfterKickoff() {
|
||||
let kickoff = "2026-09-06T07:00:00Z"
|
||||
let now = iso("2026-09-06T08:30:00Z")
|
||||
XCTAssertTrue(ApiInstant.isScheduledOnCalendar(kickoff, now: now))
|
||||
XCTAssertFalse(ApiInstant.isScheduledFuture(kickoff, now: now))
|
||||
}
|
||||
|
||||
func testIsScheduledOnCalendarHidesYesterday() {
|
||||
let yesterday = "2026-09-05T10:00:00Z"
|
||||
let now = iso("2026-09-06T08:30:00Z")
|
||||
XCTAssertFalse(ApiInstant.isScheduledOnCalendar(yesterday, now: now))
|
||||
}
|
||||
|
||||
func testConcurrentStreamForbiddenShowsApiMessage() {
|
||||
let body = """
|
||||
{"error":"Hai già una diretta in corso con questo account. Chiudila prima di avviarne un’altra.","error_code":"user_concurrent_stream"}
|
||||
"""
|
||||
XCTAssertEqual(
|
||||
APIError.http(403, body).errorDescription,
|
||||
"Hai già una diretta in corso con questo account. Chiudila prima di avviarne un’altra."
|
||||
)
|
||||
}
|
||||
|
||||
private func iso(_ value: String) -> Date {
|
||||
let f = ISO8601DateFormatter()
|
||||
f.formatOptions = [.withInternetDateTime]
|
||||
guard let date = f.date(from: value) else {
|
||||
XCTFail("Data ISO non valida: \(value)")
|
||||
return Date()
|
||||
}
|
||||
return date
|
||||
}
|
||||
func testOverlayKindMapping() {
|
||||
XCTAssertEqual(OverlayKindMapping.fromApi("basket"), "basket")
|
||||
XCTAssertEqual(OverlayKindMapping.fromApi("none"), "none")
|
||||
|
||||
@@ -121,6 +121,65 @@ final class MatchScoringRulesTests: XCTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
final class MatchHubCalendarTests: XCTestCase {
|
||||
func testHubKeepsMatchAfterKickoffSameDay() {
|
||||
let now = iso("2026-09-06T08:30:00Z")
|
||||
let match = hubMatch(scheduledAt: "2026-09-06T07:00:00Z")
|
||||
XCTAssertTrue(MatchHubFilter.coachHubVisible(match, now: now))
|
||||
XCTAssertTrue(MatchHubFilter.isOnCalendar(match, now: now))
|
||||
XCTAssertFalse(MatchHubFilter.isScheduledFuture(match, now: now))
|
||||
}
|
||||
|
||||
func testHubHidesYesterdayMatch() {
|
||||
let now = iso("2026-09-06T08:30:00Z")
|
||||
let match = hubMatch(scheduledAt: "2026-09-05T10:00:00Z")
|
||||
XCTAssertFalse(MatchHubFilter.coachHubVisible(match, now: now))
|
||||
}
|
||||
|
||||
func testHubRespectsApiCoachHubVisibleFalse() {
|
||||
let now = iso("2026-09-06T08:30:00Z")
|
||||
let match = hubMatch(scheduledAt: "2026-09-06T07:00:00Z", coachHubVisible: false)
|
||||
XCTAssertFalse(MatchHubFilter.coachHubVisible(match, now: now))
|
||||
}
|
||||
|
||||
private func iso(_ value: String) -> Date {
|
||||
let f = ISO8601DateFormatter()
|
||||
f.formatOptions = [.withInternetDateTime]
|
||||
return f.date(from: value)!
|
||||
}
|
||||
|
||||
private func hubMatch(scheduledAt: String?, coachHubVisible: Bool? = nil) -> Match {
|
||||
Match(
|
||||
id: "match-hub",
|
||||
teamId: "team-1",
|
||||
teamName: "Team MLTV",
|
||||
opponentName: "Team Guest",
|
||||
location: nil,
|
||||
scheduledAt: scheduledAt,
|
||||
sportKey: "pallavolo",
|
||||
sportLabel: "Pallavolo",
|
||||
boardType: "volley",
|
||||
overlayKind: "volley",
|
||||
effectiveOverlayKind: "volley",
|
||||
setsToWin: 3,
|
||||
category: nil,
|
||||
scoringRules: nil,
|
||||
activeSessionId: nil,
|
||||
activeSessionStatus: nil,
|
||||
streamCompleted: false,
|
||||
coachHubVisible: coachHubVisible,
|
||||
homePrimaryColor: "#FF2D2D",
|
||||
homeSecondaryColor: nil,
|
||||
homeLogoUrl: nil,
|
||||
opponentPrimaryColor: "#1E3A8A",
|
||||
opponentLogoUrl: nil,
|
||||
effectiveCoverUrl: nil,
|
||||
coverSource: "default",
|
||||
customCoverEnabled: false
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
final class ScoreboardOverlayTests: XCTestCase {
|
||||
func testScoreboardColumnsAfterSetClosed() {
|
||||
let score = ScoreState(
|
||||
|
||||
Reference in New Issue
Block a user