mirror of
https://github.com/pointfreeco/swift-composable-architecture.git
synced 2025-12-20 09:11:33 +01:00
* Allow an alert to present another alert When we added support for vanilla SwiftUI modifiers, we lost the ability to present one alert after another because `nil` writes to the alert bindings unconditionally dismissed the feature, even if the feature was freshly presented. This fixes things by suppressing dismissal when the identity of a presented item has changed. Fix #3272. * wip
123 lines
2.4 KiB
Swift
123 lines
2.4 KiB
Swift
import TestCases
|
|
import XCTest
|
|
|
|
final class BindingLocalTests: BaseIntegrationTests {
|
|
@MainActor
|
|
override func setUpWithError() throws {
|
|
try XCTSkipIf(ProcessInfo.processInfo.environment["CI"] != nil)
|
|
try super.setUpWithError()
|
|
self.app.buttons["Legacy"].tap()
|
|
app.collectionViews.buttons[TestCase.Legacy.bindingLocal.rawValue].tap()
|
|
}
|
|
|
|
@MainActor
|
|
func testNoBindingWarning_FullScreenCover() {
|
|
app.buttons["Full-screen-cover"].tap()
|
|
|
|
app.textFields["Text"].tap()
|
|
|
|
app.buttons["Dismiss"].tap()
|
|
}
|
|
|
|
@MainActor
|
|
func testOnDisappearWarning_FullScreenCover() {
|
|
self.expectRuntimeWarnings()
|
|
|
|
app.buttons["Full-screen-cover"].tap()
|
|
|
|
app.buttons["Send onDisappear"].tap()
|
|
|
|
app.textFields["Text"].tap()
|
|
|
|
app.buttons["Dismiss"].tap()
|
|
}
|
|
|
|
@MainActor
|
|
func testNoBindingWarning_NavigationDestination() {
|
|
app.buttons["Navigation destination"].tap()
|
|
|
|
app.textFields["Text"].tap()
|
|
|
|
app.buttons["Dismiss"].tap()
|
|
}
|
|
|
|
@MainActor
|
|
func testOnDisappearWarning_NavigationDestination() {
|
|
self.expectRuntimeWarnings()
|
|
|
|
app.buttons["Navigation destination"].tap()
|
|
|
|
app.buttons["Send onDisappear"].tap()
|
|
|
|
app.textFields["Text"].tap()
|
|
|
|
app.buttons["Dismiss"].tap()
|
|
}
|
|
|
|
@MainActor
|
|
func testNoBindingWarning_Path() {
|
|
app.buttons["Path"].tap()
|
|
|
|
app.textFields["Text"].tap()
|
|
|
|
app.buttons["Dismiss"].tap()
|
|
}
|
|
|
|
@MainActor
|
|
func testOnDisappearWarning_Path() {
|
|
self.expectRuntimeWarnings()
|
|
|
|
app.buttons["Path"].tap()
|
|
|
|
app.buttons["Send onDisappear"].tap()
|
|
|
|
app.textFields["Text"].tap()
|
|
|
|
app.buttons["Dismiss"].tap()
|
|
}
|
|
|
|
@MainActor
|
|
func testNoBindingWarning_Popover() {
|
|
app.buttons["Popover"].tap()
|
|
|
|
app.textFields["Text"].tap()
|
|
|
|
app.buttons["Dismiss"].tap()
|
|
}
|
|
|
|
@MainActor
|
|
func testOnDisappearWarning_Popover() {
|
|
self.expectRuntimeWarnings()
|
|
|
|
app.buttons["Popover"].tap()
|
|
|
|
app.buttons["Send onDisappear"].tap()
|
|
|
|
app.textFields["Text"].tap()
|
|
|
|
app.buttons["Dismiss"].tap()
|
|
}
|
|
|
|
@MainActor
|
|
func testNoBindingWarning_Sheet() {
|
|
app.buttons["Sheet"].tap()
|
|
|
|
app.textFields["Text"].tap()
|
|
|
|
app.buttons["Dismiss"].tap()
|
|
}
|
|
|
|
@MainActor
|
|
func testOnDisappearWarning_Sheet() {
|
|
self.expectRuntimeWarnings()
|
|
|
|
app.buttons["Sheet"].tap()
|
|
|
|
app.buttons["Send onDisappear"].tap()
|
|
|
|
app.textFields["Text"].tap()
|
|
|
|
app.buttons["Dismiss"].tap()
|
|
}
|
|
}
|