test(overlay): cover token guard outcomes
This commit is contained in:
21
apps/macos/Tests/ClawdisIPCTests/VoiceWakeOverlayTests.swift
Normal file
21
apps/macos/Tests/ClawdisIPCTests/VoiceWakeOverlayTests.swift
Normal file
@@ -0,0 +1,21 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdis
|
||||
|
||||
@Suite struct VoiceWakeOverlayTests {
|
||||
@Test func guardTokenDropsWhenNoActive() {
|
||||
let outcome = VoiceWakeOverlayController.evaluateToken(active: nil, incoming: UUID())
|
||||
#expect(outcome == .drop)
|
||||
}
|
||||
|
||||
@Test func guardTokenAcceptsMatching() {
|
||||
let token = UUID()
|
||||
let outcome = VoiceWakeOverlayController.evaluateToken(active: token, incoming: token)
|
||||
#expect(outcome == .accept)
|
||||
}
|
||||
|
||||
@Test func guardTokenDismissesMismatch() {
|
||||
let outcome = VoiceWakeOverlayController.evaluateToken(active: UUID(), incoming: UUID())
|
||||
#expect(outcome == .dismiss)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user