Skip to content

Commit

Permalink
Fix tests for iOS 18+
Browse files Browse the repository at this point in the history
  • Loading branch information
joemasilotti committed Dec 17, 2024
1 parent 8ea50d3 commit b14e347
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Tests/Turbo/Navigator/NavigationHierarchyControllerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,16 @@ final class NavigationHierarchyControllerTests: XCTestCase {
context: .modal
)
navigator.route(proposal)
// NOTE: For most view controllers, UIKit maps `automatic` style to the UIModalPresentationStyle.pageSheet style,
// but some system view controllers may map it to a different style.
XCTAssertEqual(modalNavigationController.modalPresentationStyle, .pageSheet)
// For most view controllers, UIKit maps [automatic] to:
// UIModalPresentationStyle.formSheet in iOS 18 and later
// UIModalPresentationStyle.pageSheet in versions of iOS earlier than iOS 18
// Some system view controllers may map it to a different style.
// https://developer.apple.com/documentation/uikit/uimodalpresentationstyle/automatic
if #available(iOS 18, *) {
XCTAssertEqual(modalNavigationController.modalPresentationStyle, .formSheet)
} else {
XCTAssertEqual(modalNavigationController.modalPresentationStyle, .pageSheet)
}
}

func test_modalDismissGestureEnabled_isCorrectlySet() throws {
Expand Down

0 comments on commit b14e347

Please sign in to comment.