Files
swift-composable-architectu…/Sources/ComposableArchitecture/Documentation.docc/Tutorials/BuildingSyncUps/06-SyncUpDetail/TestingSyncUpDetail-02-code-0005.swift
Brandon Williams dd145a13c5 Fix focus in tutorial (#3072)
* Fix focus logic in tutorial.

* wip

* wip

* wip

* wip

* remove extra alert enum

* wip
2024-05-13 14:07:39 -07:00

31 lines
687 B
Swift

import ComposableArchitecture
import XCTest
@testable import SyncUps
class SyncUpDetailTests: XCTestCase {
@MainActor
func testDelete() async {
let syncUp = SyncUp(
id: SyncUp.ID(),
title: "Point-Free Morning Sync"
)
let store = TestStore(initialState: SyncUpDetail.State(syncUp: Shared(syncUp))) {
SyncUpDetail()
}
await store.send(.deleteButtonTapped) {
$0.destination = .alert(.deleteSyncUp)
}
await store.send(.destination(.presented(.alert(.confirmButtonTapped)))) {
$0.destination = nil
}
await store.receive(\.delegate.deleteSyncUp, syncUp.id)
}
@MainActor
func testEdit() async {
// ...
}
}