import InlineSnapshotTesting import TestCases import XCTest final class iOS16_17_NewContainsOldTests: BaseIntegrationTests { @MainActor override func setUp() { super.setUp() self.app.buttons["iOS 16 + 17"].tap() self.app.buttons["New containing old"].tap() self.clearLogs() // SnapshotTesting.isRecording = true } @MainActor func testIncrementDecrement() { self.app.buttons.matching(identifier: "Increment").element(boundBy: 0).tap() XCTAssertEqual(self.app.staticTexts["1"].exists, true) self.assertLogs { """ NewContainsOldTestCase.body """ } self.app.buttons.matching(identifier: "Decrement").element(boundBy: 0).tap() XCTAssertEqual(self.app.staticTexts["-1"].exists, true) self.assertLogs { """ BasicsView.body StoreOf.deinit StoreOf.deinit StoreOf.init StoreOf.init ViewStoreOf.deinit ViewStoreOf.deinit ViewStoreOf.init ViewStoreOf.init WithViewStoreOf.body """ } } @MainActor func testObserveChildCount() { self.app.buttons["Toggle observe child count"].tap() XCTAssertEqual(self.app.staticTexts["Child count: 0"].exists, true) self.assertLogs { """ NewContainsOldTestCase.body """ } } @MainActor func testIncrementChild_ObservingChildCount() { self.app.buttons["Toggle observe child count"].tap() self.clearLogs() self.app.buttons.matching(identifier: "Increment").element(boundBy: 1).tap() XCTAssertEqual(self.app.staticTexts["1"].exists, true) XCTAssertEqual(self.app.staticTexts["Child count: 1"].exists, true) self.assertLogs { """ BasicsView.body NewContainsOldTestCase.body StoreOf.deinit StoreOf.deinit StoreOf.init StoreOf.init ViewStoreOf.deinit ViewStoreOf.deinit ViewStoreOf.init ViewStoreOf.init WithViewStoreOf.body """ } } @MainActor func testDeinit() { self.app.buttons["Toggle observe child count"].tap() self.app.buttons.matching(identifier: "Increment").element(boundBy: 1).tap() self.clearLogs() self.app.buttons["iOS 16 + 17"].tap() self.assertLogs { """ StoreOf.deinit StoreOf.deinit ViewStoreOf.deinit """ } } }