Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Identifier to inverted snapshot tests #55

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Example/AccessibilitySnapshot/InvertColorsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ final class InvertColorsViewController: AccessibilityViewController {

private var notificationObserver: AnyObject?

// MARK: - Life Cycle

init() {
super.init(nibName: nil, bundle: nil)

updateStatusLabel()
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

// MARK: - UIViewController

override func viewDidLoad() {
Expand Down
13 changes: 13 additions & 0 deletions Example/SnapshotTests/InvertColorsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,17 @@ final class InvertColorsTests: SnapshotTestCase {
SnapshotVerifyWithInvertedColors(viewController.view)
}

func testInvertColorsWithIdentifier() {
let viewController = InvertColorsViewController()
viewController.view.frame = UIScreen.main.bounds

FBSnapshotVerifyView(viewController.view, identifier: "originalColors")

SnapshotVerifyWithInvertedColors(viewController.view, identifier: "invertedColors")

// Ensures the view has not been modified after calling SnapshotVerifyWithInvertedColors
FBSnapshotVerifyView(viewController.view, identifier: "originalColors")

}

}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ extension FBSnapshotTestCase {
}

let imageView = UIImageView(image: image)
FBSnapshotVerifyView(imageView, file: file, line: line)
FBSnapshotVerifyView(imageView, identifier: identifier, file: file, line: line)

statusUtility.unmockStatuses()
postNotification()
Expand Down