diff --git a/Example/AccessibilitySnapshot/InvertColorsViewController.swift b/Example/AccessibilitySnapshot/InvertColorsViewController.swift index adfe271f..8a78f561 100644 --- a/Example/AccessibilitySnapshot/InvertColorsViewController.swift +++ b/Example/AccessibilitySnapshot/InvertColorsViewController.swift @@ -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() { diff --git a/Example/SnapshotTests/InvertColorsTests.swift b/Example/SnapshotTests/InvertColorsTests.swift index b5a6e9df..747179a6 100644 --- a/Example/SnapshotTests/InvertColorsTests.swift +++ b/Example/SnapshotTests/InvertColorsTests.swift @@ -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") + + } + } diff --git a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.InvertColorsTests/testInvertColorsWithIdentifier_invertedColors_12_4_375x812@3x.png b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.InvertColorsTests/testInvertColorsWithIdentifier_invertedColors_12_4_375x812@3x.png new file mode 100644 index 00000000..eb3b8af4 Binary files /dev/null and b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.InvertColorsTests/testInvertColorsWithIdentifier_invertedColors_12_4_375x812@3x.png differ diff --git a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.InvertColorsTests/testInvertColorsWithIdentifier_invertedColors_13_3_375x812@3x.png b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.InvertColorsTests/testInvertColorsWithIdentifier_invertedColors_13_3_375x812@3x.png new file mode 100644 index 00000000..ade8d974 Binary files /dev/null and b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.InvertColorsTests/testInvertColorsWithIdentifier_invertedColors_13_3_375x812@3x.png differ diff --git a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.InvertColorsTests/testInvertColorsWithIdentifier_invertedColors_14_2_390x844@3x.png b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.InvertColorsTests/testInvertColorsWithIdentifier_invertedColors_14_2_390x844@3x.png new file mode 100644 index 00000000..1c951424 Binary files /dev/null and b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.InvertColorsTests/testInvertColorsWithIdentifier_invertedColors_14_2_390x844@3x.png differ diff --git a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.InvertColorsTests/testInvertColorsWithIdentifier_originalColors_12_4_375x812@3x.png b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.InvertColorsTests/testInvertColorsWithIdentifier_originalColors_12_4_375x812@3x.png new file mode 100644 index 00000000..6b45b9a1 Binary files /dev/null and b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.InvertColorsTests/testInvertColorsWithIdentifier_originalColors_12_4_375x812@3x.png differ diff --git a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.InvertColorsTests/testInvertColorsWithIdentifier_originalColors_13_3_375x812@3x.png b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.InvertColorsTests/testInvertColorsWithIdentifier_originalColors_13_3_375x812@3x.png new file mode 100644 index 00000000..53584a0e Binary files /dev/null and b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.InvertColorsTests/testInvertColorsWithIdentifier_originalColors_13_3_375x812@3x.png differ diff --git a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.InvertColorsTests/testInvertColorsWithIdentifier_originalColors_14_2_390x844@3x.png b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.InvertColorsTests/testInvertColorsWithIdentifier_originalColors_14_2_390x844@3x.png new file mode 100644 index 00000000..4ffb5654 Binary files /dev/null and b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.InvertColorsTests/testInvertColorsWithIdentifier_originalColors_14_2_390x844@3x.png differ diff --git a/Sources/AccessibilitySnapshot/iOSSnapshotTestCase/FBSnapshotTestCase+Accessibility.swift b/Sources/AccessibilitySnapshot/iOSSnapshotTestCase/FBSnapshotTestCase+Accessibility.swift index dfb89275..716a3030 100644 --- a/Sources/AccessibilitySnapshot/iOSSnapshotTestCase/FBSnapshotTestCase+Accessibility.swift +++ b/Sources/AccessibilitySnapshot/iOSSnapshotTestCase/FBSnapshotTestCase+Accessibility.swift @@ -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()