Created the Commanding package target in the Features package for controlling the recording flow from Live Activities.
This commit is contained in:
@@ -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])
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user