From f05df17cdd726e51dbc3cf1ca6293d4c11e6fcb5 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 12 Jul 2026 16:47:05 +0200 Subject: [PATCH] test(ios): guard every localized runtime label --- .../RuntimeLocalizationSourceGuardTests.swift | 49 ++++++++++++++++--- 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/apps/ios/Tests/RuntimeLocalizationSourceGuardTests.swift b/apps/ios/Tests/RuntimeLocalizationSourceGuardTests.swift index f9fdf1768266..165e12246299 100644 --- a/apps/ios/Tests/RuntimeLocalizationSourceGuardTests.swift +++ b/apps/ios/Tests/RuntimeLocalizationSourceGuardTests.swift @@ -81,17 +81,54 @@ struct RuntimeLocalizationSourceGuardTests { #expect(watchInbox.contains("case localized(LocalizedStringResource)")) #expect(!watchInbox.contains("WatchTextValue: ExpressibleByStringLiteral")) #expect(watchInbox.contains("accessory: .verbatim(self.store.talkSummaryText)")) - #expect(rootTabs.contains("String(localized: \"Needs attention\")")) - #expect(rootTabsNavigation.contains("case .gateway: String(localized: \"Settings / Gateway\")")) - #expect(phoneControlHub.contains("case .error: String(localized: \"Attention\")")) + for status in ["Online", "Connecting", "Needs attention", "Offline"] { + #expect(rootTabs.contains("String(localized: \"\(status)\")")) + } + let destinationTitles = [ + "Chat", + "Talk", + "Overview", + "Activity", + "Agents", + "Workboard", + "Skill Workshop", + "Instances", + "Sessions", + "Files", + "Dreaming", + "Usage", + "Cron Jobs", + "Terminal", + "Docs", + "Settings", + "Settings / Gateway", + ] + for title in destinationTitles { + #expect(rootTabsNavigation.contains("String(localized: \"\(title)\")")) + } + #expect(rootTabsNavigation.contains("case .gateway: String(localized: \"Connection\")")) + for status in ["Online", "Connecting", "Attention", "Offline"] { + #expect(phoneControlHub.contains("String(localized: \"\(status)\")")) + #expect(proComponents.contains("String(localized: \"\(status)\")")) + } #expect(phoneControlHub.contains("String(localized: \"Default Agent\")")) #expect(proComponents.contains("OpenClawStatusBadge(label: .verbatim(self.title)")) - #expect(proComponents.contains("String(localized: \"Online\")")) #expect(skillWorkshop.contains("String(localized: \"Default agent\")")) + #expect(workboard.components(separatedBy: "String(localized: \"Default agent\")").count - 1 == 2) #expect(!workboard.contains("?? \"Default agent\"")) #expect(talkPro.contains("if title.isEmpty { return String(localized: \"Not active\") }")) - #expect(talkManager.contains("String(localized: \"iOS Speech fallback\")")) - #expect(talkManager.contains("String(localized: \"Realtime unavailable\")")) + #expect(talkManager.contains( + "var gatewayTalkActiveModeTitle: String = .init(localized: \"Not active\")")) + for title in [ + "Not active", + "Paused", + "Realtime unavailable", + "iOS Speech + TTS", + "iOS Speech fallback", + ] { + #expect(talkManager.contains("localized: \"\(title)\"")) + } + #expect(!talkManager.contains("gatewayTalkActiveModeTitle: String = \"")) #expect(!talkManager.contains("gatewayTalkActiveModeTitle = \"")) }