Add 87 new tests (384 total) covering ValidationRules/ValidationError, PasswordResetViewModel navigation and client-side validation, WidgetAction Codable/Equatable/accessors, parseDate, and ThemeID enum properties. Updates greenfield CSV for AUTH-012/017/018, NOTIF-006/007, WID-003, THEME-002. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
51 lines
1.3 KiB
Swift
51 lines
1.3 KiB
Swift
//
|
|
// ThemeIDTests.swift
|
|
// CaseraTests
|
|
//
|
|
// Unit tests for ThemeID enum properties and round-tripping.
|
|
//
|
|
|
|
import Testing
|
|
@testable import Casera
|
|
|
|
// MARK: - ThemeID Enum Tests
|
|
|
|
struct ThemeIDTests {
|
|
|
|
@Test func allCasesCountIsEleven() {
|
|
#expect(ThemeID.allCases.count == 11)
|
|
}
|
|
|
|
@Test func allDisplayNamesAreNonEmpty() {
|
|
for theme in ThemeID.allCases {
|
|
#expect(!theme.displayName.isEmpty, "ThemeID.\(theme) has empty displayName")
|
|
}
|
|
}
|
|
|
|
@Test func allDescriptionsAreNonEmpty() {
|
|
for theme in ThemeID.allCases {
|
|
#expect(!theme.description.isEmpty, "ThemeID.\(theme) has empty description")
|
|
}
|
|
}
|
|
|
|
@Test func rawValueRoundTripsForAllCases() {
|
|
for theme in ThemeID.allCases {
|
|
let roundTripped = ThemeID(rawValue: theme.rawValue)
|
|
#expect(roundTripped == theme, "ThemeID.\(theme) failed rawValue round-trip")
|
|
}
|
|
}
|
|
|
|
@Test func allRawValuesAreUnique() {
|
|
let rawValues = ThemeID.allCases.map(\.rawValue)
|
|
#expect(Set(rawValues).count == rawValues.count)
|
|
}
|
|
|
|
@Test func brightDisplayNameIsDefault() {
|
|
#expect(ThemeID.bright.displayName == "Default")
|
|
}
|
|
|
|
@Test func oceanRawValueIsOcean() {
|
|
#expect(ThemeID.ocean.rawValue == "Ocean")
|
|
}
|
|
}
|