Replies: 3 comments 3 replies
-
@tomassliz That failure looks like maybe line 24 of step 5 is missing: $0.focus = .attendee(attendee2.id) That line should make things pass. Since this is a tutorial step and not a bug in the library, I'm going to convert to a discussion, but let us know if that fixes things for you or if there's still a problem! |
Beta Was this translation helpful? Give feedback.
-
I just hit precisely this test failure, and agree that this appears to be a bug in the tutorial. At the state of the code at |
Beta Was this translation helpful? Give feedback.
-
I hit this too. From this comment that shows further below in the same tutorial page, I reckon that the intended logic is not implemented in the reducer: What happens when there are two attendees, neither of which is focused, and you delete one? We would expect that the focus does not change, but the best way to prove that is to write a test. So in testRemoveAttendee() we don't have an explicit focus set, so the SyncUpForm.State defaults to focus on .title. Which means that the attendee we're deleting is not focused and we should not expect the focus to move to the remaining attendee. For this reason I get that the test is OK but the reducer is not doing what it's meant to. Making this change in the reducer I get the test to pass.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
In the Section 1 Removing attendees there is a test called
testRemoveAttendee
that will fail even though you have followed the instructions. The issue is that thefocus
property value changes unexpectedly:There is also a note
I'm not sure how you want to drive the tutorial so I just open this issue without a fix.
Checklist
main
branch of this package.Expected behavior
The test should pass.
Actual behavior
The test doesn't pass.
Steps to reproduce
No response
The Composable Architecture version information
No response
Destination operating system
iOS 17
Xcode version information
15.4
Swift Compiler version information
Beta Was this translation helpful? Give feedback.
All reactions