Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save fjtrujy/c984c0f0d8ed280919880cd6ffa84c46 to your computer and use it in GitHub Desktop.

Select an option

Save fjtrujy/c984c0f0d8ed280919880cd6ffa84c46 to your computer and use it in GitHub Desktop.
WhatsappStatusCellSnapshotTestsBasic - Snapshot Testing
class WhatsappStatusCellSnapshotTestsBasic: FBSnapshotTestCase {
var cell: WhatsappStatusCell?
override func setUp() {
super.setUp()
recordMode = false
let decorator = WhatsappStatusCellDecorator(imageName: "trujy",
title: "Francisco Trujillo",
subtitle: "5 minutes ago",
buttons: false)
let nibFile = Bundle.main.loadNibNamed(String(describing: WhatsappStatusCell.self), owner: nil, options: nil)
guard let cell = nibFile?.first as? WhatsappStatusCell else { return }
cell.configure(decorator: decorator)
self.cell = cell
}
func testPortraitLayout() {
cell?.adjustToFitScreen(orientation: .portrait)
FBSnapshotVerifyView(cell!)
}
func testLandScapeLayout() {
cell?.adjustToFitScreen(orientation: .landscapeLeft)
FBSnapshotVerifyView(cell!)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment