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.deinit ViewStoreOf.init WithViewStoreOf.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.deinit ViewStoreOf.init WithViewStoreOf.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.deinit ViewStoreOf.init WithViewStoreOf.body """ } } }