//
//  LoadingSpinnerTests.swift
//  SportsTimeTests
//

import Testing
import SwiftUI
@testable import SportsTime

struct LoadingSpinnerTests {

    @Test func smallSizeHasCorrectDimensions() {
        let config = LoadingSpinner.Size.small
        #expect(config.diameter == 16)
        #expect(config.strokeWidth == 2)
    }

    @Test func mediumSizeHasCorrectDimensions() {
        let config = LoadingSpinner.Size.medium
        #expect(config.diameter == 24)
        #expect(config.strokeWidth == 3)
    }

    @Test func largeSizeHasCorrectDimensions() {
        let config = LoadingSpinner.Size.large
        #expect(config.diameter == 40)
        #expect(config.strokeWidth == 4)
    }

    @Test func spinnerCanBeCreatedWithAllSizes() {
        let small = LoadingSpinner(size: .small)
        let medium = LoadingSpinner(size: .medium)
        let large = LoadingSpinner(size: .large)

        #expect(small.size == .small)
        #expect(medium.size == .medium)
        #expect(large.size == .large)
    }

    @Test func spinnerCanHaveOptionalLabel() {
        let withLabel = LoadingSpinner(size: .medium, label: "Loading...")
        let withoutLabel = LoadingSpinner(size: .medium)

        #expect(withLabel.label == "Loading...")
        #expect(withoutLabel.label == nil)
    }
}
