Files
Stephen Celis 08faf84fe3 MainActor Store Isolation (#3277)
* `@preconcurrency @MainActor` isolation of `Store`

* Remove unneeded `@MainActor`s

* Remove thread checking code

* Remove unneeded `@MainActor`s

* Swift 5.10 compatibility fixes

* wip

* More 5.10 fixes

* wip

* fixes

* wip

* wip

* up the timeout

* wip

* Fixes

* Remove mainActorASAP in favor of mainActorNow. (#3288)

* wip

* Run swift-format

* Update README.md

* Fix integration tests. (#3294)

* Fix integration tests.

* wip

* wip

* Run swift-format

* mainActorNow doesnt need escaping closure

* wip

* migration guide

* wip

* Update MigratingTo1.14.md

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
Co-authored-by: Brandon Williams <135203+mbrandonw@users.noreply.github.com>
Co-authored-by: mbrandonw <mbrandonw@users.noreply.github.com>
2024-08-27 10:57:46 -07:00

42 lines
961 B
Swift

import ComposableArchitecture
import XCTest
@testable import SyncUps
class SyncUpsListTests: XCTestCase {
func testAddSyncUp() async {
let store = await TestStore(initialState: SyncUpsList.State()) {
SyncUpsList()
} withDependencies: {
$0.uuid = .incrementing
}
await store.send(.addSyncUpButtonTapped) {
$0.addSyncUp = SyncUpForm.State(
syncUp: SyncUp(id: SyncUp.ID(0))
)
}
let editedSyncUp = SyncUp(
id: SyncUp.ID(0),
attendees: [
Attendee(id: Attendee.ID(), name: "Blob"),
Attendee(id: Attendee.ID(), name: "Blob Jr."),
],
title: "Point-Free morning sync"
)
await store.send(.addSyncUp(.presented(.set(\.syncUp, editedSyncUp)))) {
$0.addSyncUp?.syncUp = editedSyncUp
}
await store.send(.confirmAddButtonTapped) {
$0.addSyncUp = nil
// $0.syncUps = [editedSyncUp]
}
}
func testDeletion() async {
// ...
}
}