Skip to content

Commit

Permalink
Add the version of testSharingWithDelegateAction that works today
Browse files Browse the repository at this point in the history
  • Loading branch information
rcarver committed Oct 21, 2024
1 parent 910720c commit f6fe6c6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Tests/ComposableArchitectureTests/SharedTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,25 @@ final class SharedTests: XCTestCase {
}
}

@MainActor
func testSharingWithDelegateAction_eagerActionProcessing() async {
let store = TestStore(
initialState: SharedFeature.State(
profile: Shared(Profile(stats: Shared(Stats()))),
sharedCount: Shared(0),
stats: Shared(Stats())
)
) {
SharedFeature()
}
await store.send(.incrementSharedInDelegate) {
$0.stats.count = 1
}
await store.receive(\.delegate.didIncrement) {
$0.count = 1
}
}

@MainActor
func testSharing_Failure() async {
let store = TestStore(
Expand Down

0 comments on commit f6fe6c6

Please sign in to comment.