mirror of
https://github.com/home-assistant/iOS.git
synced 2026-06-21 19:57:06 -05:00
## Summary - Add unit coverage for `AppIcon` title mapping across all cases - Verify `darkIcon` behavior for shared and per-icon assets - Cover debug default-selection behavior for `isDefault` and `iconName`
35 lines
1.2 KiB
Swift
35 lines
1.2 KiB
Swift
@testable import HomeAssistant
|
|
@testable import Shared
|
|
import Testing
|
|
|
|
struct AppIconTests {
|
|
@Test func testAllIconsHaveLocalizedTitles() async throws {
|
|
#expect(AppIcon.allCases.count == 25)
|
|
|
|
for icon in AppIcon.allCases {
|
|
#expect(icon.title.isEmpty == false, "\(icon.rawValue) should have a localized title")
|
|
}
|
|
}
|
|
|
|
@Test func testDarkIconUsesSharedDarkModeAssetForSupportedIcons() async throws {
|
|
#expect(AppIcon.Release.darkIcon == "icon-dark-mode")
|
|
#expect(AppIcon.Beta.darkIcon == "icon-dark-mode")
|
|
#expect(AppIcon.White.darkIcon == "icon-dark-mode")
|
|
}
|
|
|
|
@Test func testDarkIconUsesPerIconAssetForNonDefaultDarkModeIcons() async throws {
|
|
#expect(AppIcon.Dev.darkIcon == "icon-dev")
|
|
#expect(AppIcon.FireOrange.darkIcon == "icon-fire-orange")
|
|
#expect(AppIcon.BiPride.darkIcon == "icon-bi_pride")
|
|
}
|
|
|
|
@Test func testDebugConfigurationSelectsDevAsDefaultIcon() async throws {
|
|
#expect(Current.appConfiguration == .debug)
|
|
#expect(AppIcon.Dev.isDefault)
|
|
#expect(AppIcon.Dev.iconName == nil)
|
|
|
|
#expect(AppIcon.Release.isDefault == false)
|
|
#expect(AppIcon.Release.iconName == AppIcon.Release.rawValue)
|
|
}
|
|
}
|