New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update docs/examples to leverage TestStore.send(\.path)
#2868
Conversation
@@ -24,11 +24,11 @@ final class AlertsAndConfirmationDialogsTests: XCTestCase { | |||
TextState("This is an alert") | |||
} | |||
} | |||
await store.send(.alert(.presented(.incrementButtonTapped))) { | |||
await store.send(\.alert.incrementButtonTapped) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to squash .presented
where we can.
@@ -10,17 +10,17 @@ final class BindingFormTests: XCTestCase { | |||
BindingForm() | |||
} | |||
|
|||
await store.send(.set(\.sliderValue, 2)) { | |||
await store.send(\.sliderValue, 2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because bindable actions are case pathable, we can further avoid the .set
helper (so maybe it can even be deprecated).
@@ -17,24 +17,22 @@ final class AppFeatureTests: XCTestCase { | |||
) | |||
} | |||
|
|||
await store.send(.path(.push(id: 0, state: .detail(SyncUpDetail.State(syncUp: syncUp))))) { | |||
await store.send(\.path[id:0], .detail(SyncUpDetail.State(syncUp: syncUp))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a case path for pushing/popping based off state vs. nil
. Here's pushing...
$0.path[id: 0, case: \.detail]?.destination = nil | ||
} | ||
|
||
await store.receive(\.path[id:0].detail.delegate.deleteSyncUp) { | ||
$0.syncUpsList.syncUps = [] | ||
} | ||
await store.receive(\.path.popFrom) { | ||
await store.receive(\.path[id:0], nil) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here's popping.
…ure to from: "1.9.0" (#940) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [pointfreeco/swift-composable-architecture](https://togithub.com/pointfreeco/swift-composable-architecture) | minor | `from: "1.8.2"` -> `from: "1.9.0"` | --- ### Release Notes <details> <summary>pointfreeco/swift-composable-architecture (pointfreeco/swift-composable-architecture)</summary> ### [`v1.9.0`](https://togithub.com/pointfreeco/swift-composable-architecture/releases/tag/1.9.0) [Compare Source](https://togithub.com/pointfreeco/swift-composable-architecture/compare/1.8.2...1.9.0) #### What's Changed See [Migrating to 1.9](https://togithub.com/pointfreeco/swift-composable-architecture/blob/main/Sources/ComposableArchitecture/Documentation.docc/Articles/MigrationGuides/MigratingTo1.9.md) for more details. - Added: New versions of `TestStore.send` that accept case key paths (thanks [@​scogeo](https://togithub.com/scogeo), [pointfreeco/swift-composable-architecture#2681; [pointfreeco/swift-composable-architecture#2868). - Added `Reducer.dependency(value)`, for overriding a reducer's dependency using a singleton value of a type ([pointfreeco/swift-composable-architecture#2863). - Fixed: Improve `Store` diagnostics for deriving bindings ([pointfreeco/swift-composable-architecture#2793). - Fixed: Avoid erroneous perception checks when `ViewStore`s are initialized in a view that doesn't use `WithPerceptionTracking` ([pointfreeco/swift-composable-architecture#2849). - Fixed: Support `#if` branching in `@ObservableState` and enum `@Reducer`s ([pointfreeco/swift-composable-architecture#2800). - Infrastructure: Tree navigation documentation fixes (thanks [@​imjn](https://togithub.com/imjn), [pointfreeco/swift-composable-architecture#2837); presentation reducer documentation fixes (thanks [@​ozumin](https://togithub.com/ozumin), [pointfreeco/swift-composable-architecture#2853). - Infrastructure: Improve tutorial diffing (thanks [@​oka-yuji](https://togithub.com/oka-yuji), [pointfreeco/swift-composable-architecture#2844). - Infrastructure: Expand release build test coverage ([pointfreeco/swift-composable-architecture#2856). - Infrastructure: Document gotcha with macros and previews ([pointfreeco/swift-composable-architecture#2855). #### New Contributors - [@​imjn](https://togithub.com/imjn) made their first contribution in [pointfreeco/swift-composable-architecture#2837 - [@​oka-yuji](https://togithub.com/oka-yuji) made their first contribution in [pointfreeco/swift-composable-architecture#2844 - [@​ozumin](https://togithub.com/ozumin) made their first contribution in [pointfreeco/swift-composable-architecture#2853 **Full Changelog**: pointfreeco/swift-composable-architecture@1.8.2...1.9.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDAuMCIsInVwZGF0ZWRJblZlciI6IjM2LjEwMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: Self-hosted Renovate Bot <361546+cgrindel-self-hosted-renovate[bot]@users.noreply.github.enterprise.com>
With #2681 merged, let's update the code base accordingly.