Skip to content

Navigator_GoBackToInvocation

ohitsdaniel edited this page Apr 29, 2021 · 2 revisions

Navigator.GoBackToInvocation

Testing helper

struct GoBackToInvocation: Hashable 

Example

 var invocations = [Navigator.GoBackToInvocation]()
 let expectectedInvocations = [
   Navigator.GoBackToInvocation(id: .screen(parent.eraseToAnyScreen()))
 ]

 let sut = Navigator.mock(
   path: { self.path },
   goBack: { screen in
     invocations.append(.init(id: id))
   }
 )

 sut.goBack(to: parent) // invoke code that invokes goBack(to:)

 XCTAssertEqual(expectectedInvocations, invocations)

Inheritance

Hashable

Properties

to

let to: NavigationIdentifier
Clone this wiki locally