Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrandonw committed Mar 7, 2023
1 parent 79c64d2 commit a5f285a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ private struct PresentationTestCase: ReducerProtocol {
)
return .none
case .destination(.presented(.fullScreenCover(.parentSendDismissActionButtonTapped))),
.destination(.presented(.navigationDestination(.parentSendDismissActionButtonTapped))),
.destination(.presented(.sheet(.parentSendDismissActionButtonTapped))),
.destination(.presented(.popover(.parentSendDismissActionButtonTapped))):
return .send(.destination(.dismiss))
Expand Down
16 changes: 16 additions & 0 deletions Examples/Integration/IntegrationUITests/PresentationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,20 @@ final class PresentationTests: XCTestCase {
self.app.buttons["Parent dismiss"].tap()
XCTAssertEqual(false, self.app.staticTexts["Count: 0"].exists)
}

func testNavigationDestination_EffectsCancelOnDismiss() async throws {
self.app.buttons["Open navigation destination"].tap()
XCTAssertEqual(true, self.app.staticTexts["Count: 0"].exists)

self.app.buttons["Start effect"].tap()
XCTAssertEqual(true, self.app.staticTexts["Count: 1"].exists)

self.app.buttons["Parent dismiss"].tap()
XCTAssertEqual(false, self.app.staticTexts["Count: 1"].exists)

self.app.buttons["Open navigation destination"].tap()
XCTAssertEqual(true, self.app.staticTexts["Count: 0"].exists)
try await Task.sleep(for: .seconds(3))
XCTAssertEqual(false, self.app.staticTexts["Count: 999"].exists)
}
}

0 comments on commit a5f285a

Please sign in to comment.