2025-12-09 19:51:51 +01:00
|
|
|
import Foundation
|
|
|
|
|
import Testing
|
2026-01-30 03:15:10 +01:00
|
|
|
@testable import OpenClaw
|
2025-12-09 19:51:51 +01:00
|
|
|
|
|
|
|
|
@Suite struct VoiceWakeOverlayTests {
|
|
|
|
|
@Test func guardTokenDropsWhenNoActive() {
|
|
|
|
|
let outcome = VoiceWakeOverlayController.evaluateToken(active: nil, incoming: UUID())
|
2025-12-10 00:47:49 +01:00
|
|
|
#expect(outcome == .dropNoActive)
|
2025-12-09 19:51:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test func guardTokenAcceptsMatching() {
|
|
|
|
|
let token = UUID()
|
|
|
|
|
let outcome = VoiceWakeOverlayController.evaluateToken(active: token, incoming: token)
|
|
|
|
|
#expect(outcome == .accept)
|
|
|
|
|
}
|
|
|
|
|
|
2025-12-10 00:47:49 +01:00
|
|
|
@Test func guardTokenDropsMismatchWithoutDismissing() {
|
2025-12-09 19:51:51 +01:00
|
|
|
let outcome = VoiceWakeOverlayController.evaluateToken(active: UUID(), incoming: UUID())
|
2025-12-10 00:47:49 +01:00
|
|
|
#expect(outcome == .dropMismatch)
|
2025-12-09 19:51:51 +01:00
|
|
|
}
|
|
|
|
|
}
|