pointfreeco / swift-composable-architecture

A library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind.
https://www.pointfree.co/collections/composable-architecture
MIT License
12.07k stars 1.41k forks source link

SyncUps Tutorial: Removing attendee test does not pass #3120

Closed tomassliz closed 2 months ago

tomassliz commented 2 months ago

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 the focus property value changes unexpectedly:

A state change does not match expectation: …

      SyncUpForm.State(
    −   _focus: .title,
    +   _focus: .attendee(
    +     Tagged(rawValue: UUID(1580A789-51EF-4257-86AF-4D297EB64CF0))
    +   ),
        _syncUp: SyncUp(…)
      )

(Expected: −, Actual: +)

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

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

swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0
stephencelis commented 2 months ago

@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!