Skip to content

Instantly share code, notes, and snippets.

@caldofran
Last active March 6, 2020 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caldofran/64f612630519f5c05fcafb14e40bb662 to your computer and use it in GitHub Desktop.
Save caldofran/64f612630519f5c05fcafb14e40bb662 to your computer and use it in GitHub Desktop.
Example of a snapshot navigation test
func testPresentsRightControllerWhenSelectingARow() {
// Given
let navigatorSpy = NavigatorSpy()
let sut = NotificationCenterViewController(navigator: navigatorSpy)
sut.loadViewIfNeeded()
// When
sut.selectRow(at: .init(row: 0, section: 0))
// Then
assertSnapshot(matching: navigatorSpy.handledNavigation)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment