Skip to content

Commit c444831

Browse files
Add tests for disablesAutomaticKeyboardDismissal
1 parent 36e8f4f commit c444831

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Tests/UICoreTests/ViewControllerTests.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,22 @@ final class ViewControllerTests: XCTestCase {
3838

3939
XCTAssertEqual(sut.title, "Title")
4040
}
41+
42+
func testValueOfDisablesAutomaticKeyboardDismissal() {
43+
let sut = MockViewController()
44+
45+
sut.modalPresentationStyleGetter = {
46+
return .automatic
47+
}
48+
49+
XCTAssertFalse(sut.disablesAutomaticKeyboardDismissal)
50+
51+
sut.modalPresentationStyleGetter = {
52+
return .formSheet
53+
}
54+
55+
XCTAssertTrue(sut.disablesAutomaticKeyboardDismissal)
56+
}
4157
}
4258

4359
final class MockViewController: ViewController {

0 commit comments

Comments
 (0)