mirror of
https://github.com/pointfreeco/swift-composable-architecture.git
synced 2025-12-24 12:14:25 +01:00
31 lines
687 B
Swift
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 {
|
|
// ...
|
|
}
|
|
}
|