Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions Tests/App/AppIcon.test.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@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")
Comment on lines +6 to +10
}
}

@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)
}
}
Loading