Skip to content

Commit 320cf01

Browse files
committed
[CM-1261] Comments updated.
1 parent 3a213b5 commit 320cf01

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

Sources/YBottomSheet/BottomSheetController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ internal extension BottomSheetController {
383383
}
384384

385385
@objc
386-
func simulateDismiss() {
386+
func simulateTapCloseButton() {
387387
didTapCloseButton()
388388
}
389389
}

Tests/YBottomSheetTests/BottomSheetControllerTests.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,12 @@ final class BottomSheetControllerTests: XCTestCase {
314314
XCTAssertTrue(sut.isDismissed)
315315
}
316316

317-
func test_onDidDismiss() {
317+
func test_dismissOnCloseButtonTapped() {
318318
let sut = SpyBottomSheetController(title: "", childView: UIView())
319319

320320
XCTAssertFalse(sut.isDismissed)
321321

322-
sut.simulateDismiss()
322+
sut.simulateTapCloseButton()
323323

324324
XCTAssertTrue(sut.isDismissed)
325325
}
@@ -334,10 +334,14 @@ final class BottomSheetControllerTests: XCTestCase {
334334

335335
sut.simulateOnDimmerTap()
336336
sut.simulateOnSwipeDown()
337+
_ = sut.accessibilityPerformEscape()
337338

338339
XCTAssertFalse(sut.onSwipeDown)
339340
XCTAssertFalse(sut.onDimmerTapped)
340-
XCTAssertFalse(sut.isDismissed)
341+
342+
// tap close button always dismisses
343+
sut.simulateTapCloseButton()
344+
XCTAssertTrue(sut.isDismissed)
341345
}
342346
}
343347

@@ -385,8 +389,8 @@ final class SpyBottomSheetController: BottomSheetController {
385389
var onDimmerTapped = false
386390
var onDragging = false
387391

388-
override func simulateDismiss() {
389-
super.simulateDismiss()
392+
override func simulateTapCloseButton() {
393+
super.simulateTapCloseButton()
390394
isDismissed = true
391395
}
392396

0 commit comments

Comments
 (0)