Skip to content

Commit

Permalink
update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Palma authored and Eric Palma committed Feb 26, 2025
1 parent 08db3e1 commit 616d5fc
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Tests/RoutingTests/RoutingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,43 @@ final class RoutingTests: XCTestCase {
}

func testPush() {
router.routeTo(.viewA)
router.routeTo(.viewA, via: .push)

XCTAssertEqual(router.path.count, 1)
}

func testDismissFromPush() {
router.routeTo(.viewA)
router.dismiss()
router.routeTo(.viewA, via: .push)
router.pop()

XCTAssertEqual(router.path.count, 0)
}

func testPresentSheet() {
router.routeTo(.viewB)
router.routeTo(.viewB, via: .sheet)

XCTAssertNotNil(router.presentingSheet)
XCTAssertTrue(router.isPresenting)
}

func testDismissSheet() {
router.routeTo(.viewB)
router.dismiss()
router.routeTo(.viewB, via: .sheet)
router.dismissChild()

XCTAssertNil(router.presentingSheet)
XCTAssertFalse(router.isPresenting)
}

func testPresentFullScreenCover() {
router.routeTo(.viewC)
router.routeTo(.viewC, via: .fullScreenCover)

XCTAssertNotNil(router.presentingFullScreenCover)
XCTAssertTrue(router.isPresenting)
}

func testDismissFullScreenCover() {
router.routeTo(.viewC)
router.dismiss()
router.routeTo(.viewC, via: .fullScreenCover)
router.dismissChild()

XCTAssertNil(router.presentingFullScreenCover)
XCTAssertFalse(router.isPresenting)
Expand All @@ -61,9 +61,9 @@ final class RoutingTests: XCTestCase {
// Ensure non-empty path presenting view dismisses presented view
// and does not pop path.
func testPushedPresentedDImmised() {
router.routeTo(.viewA)
router.routeTo(.viewB)
router.dismiss()
router.routeTo(.viewA, via: .push)
router.routeTo(.viewB, via: .sheet)
router.dismissChild()

XCTAssertEqual(router.path.count, 1)
XCTAssertFalse(router.isPresenting)
Expand Down

0 comments on commit 616d5fc

Please sign in to comment.