Skip to content

Instantly share code, notes, and snippets.

View caldofran's full-sized avatar

Rubén Méndez caldofran

View GitHub Profile
@caldofran
caldofran / navigation_test.swift
Last active March 6, 2020 15:30
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
@caldofran
caldofran / snapshot_result.txt
Last active March 4, 2020 14:22
An example of the result of a snapshot navigation test
▿ Navigation
▿ modal: (3 elements)
▿ .0: Screen
▿ viewController: <CandidateProcessViewController>
- id: "4224"
- .1: UIModalPresentationStyle.UIModalPresentationStyle
- completion: Optional<() -> ()>.none
@caldofran
caldofran / screen_extensions.swift
Created March 6, 2020 15:37
Screen extensions
extension Screen {
static func offer(id: String) -> Self {
return .init() { OfferViewController(id: id) }
}
}
extension Screen {
static func job(id: String) -> Self {
return .init() { JobViewController(id: id) }
}

Keybase proof

I hereby claim:

  • I am caldofran on github.
  • I am caldofran (https://keybase.io/caldofran) on keybase.
  • I have a public key ASCrrDUclWHcFz3S3dA6ju6i-pSFpsFWiqDz-NvoPY2OTQo

To claim this, I am signing this object: