Created the Commanding package target in the Features package for controlling the recording flow from Live Activities.

This commit is contained in:
2026-07-05 21:58:20 +02:00
parent cbb5703751
commit d473504d75
7 changed files with 171 additions and 0 deletions
@@ -0,0 +1,30 @@
import Testing
@testable import Commanding
@Suite("Recording commander")
struct RecordingCommanderTests {
@MainActor
@Test
func `delivers the sent commands in order`() async throws {
let commander = RecordingCommander()
commander.send(.toggle)
commander.send(.discard)
commander.send(.toggle)
var received: [RecordingCommand] = []
for await command in commander.commands {
received.append(command)
if received.count == 3 {
break
}
}
#expect(received == [.toggle, .discard, .toggle])
}
}
@@ -12,6 +12,13 @@
},
"testTargets" : [
{
"target" : {
"containerPath" : "container:",
"identifier" : "CommandingTests",
"name" : "CommandingTests"
}
},
{
"target" : {
"containerPath" : "container:",