This commit is contained in:
Michael Freno
2026-01-13 11:43:15 -05:00
parent e379c4e3e4
commit e065d72d9a
4 changed files with 299 additions and 22 deletions

View File

@@ -0,0 +1,38 @@
//
// TestingEnvironment.swift
// Gaze
//
// Created by OpenCode on 1/13/26.
//
import Foundation
/// Detects and manages testing environment states
enum TestingEnvironment {
/// Check if app is running in UI testing mode
static var isUITesting: Bool {
return ProcessInfo.processInfo.arguments.contains("--ui-testing")
}
/// Check if app should skip onboarding
static var shouldSkipOnboarding: Bool {
return ProcessInfo.processInfo.arguments.contains("--skip-onboarding")
}
/// Check if app should reset onboarding
static var shouldResetOnboarding: Bool {
return ProcessInfo.processInfo.arguments.contains("--reset-onboarding")
}
/// Check if running in any test mode (unit tests or UI tests)
static var isAnyTestMode: Bool {
return isUITesting || ProcessInfo.processInfo.environment["XCTestConfigurationFilePath"] != nil
}
#if DEBUG
/// Check if dev triggers should be visible
static var shouldShowDevTriggers: Bool {
return isUITesting || isAnyTestMode
}
#endif
}

View File

@@ -436,6 +436,7 @@ struct TimerStatusRowWithIndividualControls: View {
in: .circle
)
.help("Trigger \(displayName) reminder now (dev)")
.accessibilityIdentifier("trigger_\(displayName.replacingOccurrences(of: " ", with: "_"))")
.onHover { hovering in
isHoveredDevTrigger = hovering
}