Fix remaining 12 UI test failures: subscription state, hittability, tab selection

- IAPManager: add resetForTesting() to discard stale cached subscription state
- UITestMode: call resetForTesting() after clearing defaults (fixes 5 banner tests)
- StabilityTests: use NSPredicate wait for isSelected (iOS 26 Liquid Glass)
- SettingsActionTests: use coordinate tap for clear data and analytics toggle
- IconPackTests: add horizontal scroll fallback for off-screen icon packs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-17 17:43:28 -06:00
parent 31dfd9cc68
commit c286294cd3
5 changed files with 35 additions and 9 deletions

View File

@@ -349,6 +349,16 @@ class IAPManager: ObservableObject {
return false
}
#if DEBUG
/// Reset subscription state for UI testing. Called after group defaults are cleared
/// so that stale cached state from previous test runs is discarded.
func resetForTesting() {
state = .unknown
lastStatusCheckTime = nil
updateTrialState()
}
#endif
private func updateTrialState() {
let daysSinceInstall = Calendar.current.dateComponents([.day], from: firstLaunchDate, to: Date()).day ?? 0
let daysRemaining = trialDays - daysSinceInstall