Created
April 25, 2020 11:31
-
-
Save fjtrujy/c984c0f0d8ed280919880cd6ffa84c46 to your computer and use it in GitHub Desktop.
WhatsappStatusCellSnapshotTestsBasic - Snapshot Testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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