mirror of
https://github.com/pointfreeco/swift-composable-architecture.git
synced 2025-12-20 09:11:33 +01:00
* Typo, heirarchy -> hierarchy * Typo: recursive -> recursively * Typo: comes -> combines * Typo: is -> to be * Typo: add -> we added * Typo: 3 -> 2 * Adding a note to avoid confusion * Add more detail to step * Remove stray whitespace causing a diff to incorrectly display * Removed step documentation for unused code * Typo: apart -> a part * Typo: reducer -> reducers * Add missing mock * Fix mainactor placement * Fix transcript param not compiling * Add durationPerAttendee to be usable * Undo a whitespace change * Delete commented-out code * Update Sources/ComposableArchitecture/Documentation.docc/Tutorials/BuildingSyncUps/06-SyncUpDetail/EditingAndDeletingSyncUp.tutorial * Update Sources/ComposableArchitecture/Documentation.docc/Tutorials/BuildingSyncUps/05-PersistingSyncUps/PersistingSyncUps.tutorial * Update Sources/ComposableArchitecture/Documentation.docc/Tutorials/BuildingSyncUps/07-SyncUpDetailNavigation/MeetingNavigation-01-code-0003.swift --------- Co-authored-by: Stephen Celis <stephen.celis@gmail.com>
36 lines
961 B
Swift
36 lines
961 B
Swift
import ComposableArchitecture
|
|
import XCTest
|
|
|
|
@testable import SyncUps
|
|
|
|
final class AppFeatureTests: XCTestCase {
|
|
@MainActor
|
|
func testDelete() async throws {
|
|
let syncUp = SyncUp.mock
|
|
@Shared(.syncUps) var syncUps = [syncUp]
|
|
|
|
let store = TestStore(initialState: AppFeature.State()) {
|
|
AppFeature()
|
|
}
|
|
|
|
let sharedSyncUp = try XCTUnwrap($syncUps[id: syncUp.id])
|
|
|
|
await store.send(\.path.push, (id: 0, .detail(SyncUpDetail.State(syncUp: sharedSyncUp)))) {
|
|
$0.path[id: 0] = .detail(SyncUpDetail.State(syncUp: sharedSyncUp))
|
|
}
|
|
|
|
await store.send(\.path[id:0].detail.deleteButtonTapped) {
|
|
$0.path[id: 0]?.detail?.destination = .alert(.deleteSyncUp)
|
|
}
|
|
|
|
await store.send(\.path[id:0].detail.destination.alert.confirmButtonTapped) {
|
|
$0.path[id: 0, case: \.detail]?.destination = nil
|
|
$0.syncUpsList.syncUps = []
|
|
}
|
|
|
|
await store.receive(\.path.popFrom) {
|
|
$0.path = StackState()
|
|
}
|
|
}
|
|
}
|