//
//  StoreManagerTests.swift
//  SportsTimeTests
//

import Testing
import StoreKit
@testable import SportsTime

struct StoreManagerTests {
    @Test func shared_returnsSingletonInstance() async {
        let instance1 = await StoreManager.shared
        let instance2 = await StoreManager.shared
        #expect(instance1 === instance2)
    }

    @Test func isPro_isAccessible() async {
        let manager = await StoreManager.shared
        // Fresh state should not be Pro
        // Note: In real tests, we'd reset state first
        let _ = await manager.isPro // Just verify it's accessible
        #expect(true)
    }

    @MainActor
    @Test func proProductIDs_containsExpectedProducts() {
        #expect(StoreManager.proProductIDs.contains("com.sportstime.pro.monthly"))
        #expect(StoreManager.proProductIDs.contains("com.sportstime.pro.annual"))
        #expect(StoreManager.proProductIDs.count == 2)
    }

    @MainActor
    @Test func freeTripLimit_returnsOne() {
        #expect(StoreManager.freeTripLimit == 1)
    }
}
