mirror of
https://github.com/pointfreeco/swift-composable-architecture.git
synced 2025-12-20 09:11:33 +01:00
81 lines
2.5 KiB
Swift
81 lines
2.5 KiB
Swift
import InlineSnapshotTesting
|
|
import TestCases
|
|
import XCTest
|
|
|
|
final class iOS16_17_NewOldSiblingsTests: BaseIntegrationTests {
|
|
@MainActor
|
|
override func setUp() {
|
|
super.setUp()
|
|
self.app.buttons["iOS 16 + 17"].tap()
|
|
self.app.buttons["Siblings"].tap()
|
|
self.clearLogs()
|
|
// SnapshotTesting.isRecording = true
|
|
}
|
|
|
|
@MainActor
|
|
func testBasics() {
|
|
self.app.buttons.matching(identifier: "Increment").element(boundBy: 0).tap()
|
|
XCTAssertEqual(self.app.staticTexts["1"].exists, true)
|
|
self.assertLogs {
|
|
"""
|
|
BasicsView.body
|
|
ViewStoreOf<BasicsView.Feature>.deinit
|
|
ViewStoreOf<BasicsView.Feature>.init
|
|
WithViewStoreOf<BasicsView.Feature>.body
|
|
"""
|
|
}
|
|
|
|
self.app.buttons.matching(identifier: "Decrement").element(boundBy: 1).tap()
|
|
XCTAssertEqual(self.app.staticTexts["-1"].exists, true)
|
|
self.assertLogs {
|
|
"""
|
|
ObservableBasicsView.body
|
|
"""
|
|
}
|
|
}
|
|
|
|
@MainActor
|
|
func testResetAll() {
|
|
self.app.buttons.matching(identifier: "Increment").element(boundBy: 0).tap()
|
|
XCTAssertEqual(self.app.staticTexts["1"].exists, true)
|
|
self.app.buttons.matching(identifier: "Decrement").element(boundBy: 1).tap()
|
|
XCTAssertEqual(self.app.staticTexts["-1"].exists, true)
|
|
self.clearLogs()
|
|
self.app.buttons["Reset all"].tap()
|
|
XCTAssertEqual(self.app.staticTexts["1"].exists, false)
|
|
XCTAssertEqual(self.app.staticTexts["-1"].exists, false)
|
|
XCTAssertEqual(self.app.staticTexts["0"].exists, true)
|
|
self.assertLogs {
|
|
"""
|
|
BasicsView.body
|
|
ObservableBasicsView.body
|
|
ViewStoreOf<BasicsView.Feature>.deinit
|
|
ViewStoreOf<BasicsView.Feature>.init
|
|
WithViewStoreOf<BasicsView.Feature>.body
|
|
"""
|
|
}
|
|
}
|
|
|
|
@MainActor
|
|
func testResetSelf() {
|
|
self.app.buttons.matching(identifier: "Increment").element(boundBy: 0).tap()
|
|
XCTAssertEqual(self.app.staticTexts["1"].exists, true)
|
|
self.app.buttons.matching(identifier: "Decrement").element(boundBy: 1).tap()
|
|
XCTAssertEqual(self.app.staticTexts["-1"].exists, true)
|
|
self.clearLogs()
|
|
self.app.buttons["Reset self"].tap()
|
|
XCTAssertEqual(self.app.staticTexts["1"].exists, false)
|
|
XCTAssertEqual(self.app.staticTexts["-1"].exists, false)
|
|
XCTAssertEqual(self.app.staticTexts["0"].exists, true)
|
|
self.assertLogs {
|
|
"""
|
|
BasicsView.body
|
|
ObservableBasicsView.body
|
|
ViewStoreOf<BasicsView.Feature>.deinit
|
|
ViewStoreOf<BasicsView.Feature>.init
|
|
WithViewStoreOf<BasicsView.Feature>.body
|
|
"""
|
|
}
|
|
}
|
|
}
|