From 1dc8bcdc38e5c73611c9aed4a5c43d2d53835a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Pantale=C3=A3o?= <5808343+bgoncal@users.noreply.github.com> Date: Thu, 7 May 2026 11:22:46 +0200 Subject: [PATCH] Add AppIcon coverage tests --- Tests/App/AppIcon.test.swift | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Tests/App/AppIcon.test.swift diff --git a/Tests/App/AppIcon.test.swift b/Tests/App/AppIcon.test.swift new file mode 100644 index 000000000..6ed5589a0 --- /dev/null +++ b/Tests/App/AppIcon.test.swift @@ -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") + } + } + + @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) + } +}