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
ce81bb5789
commit
26d36213e8
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user