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

[NTV-648] Agnostic Snapshot Testing Between M1 and Intel #1794

Merged
merged 13 commits into from
Feb 22, 2023
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@testable import KsApi
@testable import Library
import Prelude
import SnapshotTesting
import XCTest

private let creator = User.template |> \.avatar.small .~ ""
Expand Down Expand Up @@ -139,7 +140,7 @@ internal final class ActivitiesViewControllerTests: TestCase {

self.scheduler.run()

FBSnapshotVerifyView(vc.view, identifier: "lang_\(language)_device_\(device)")
assertSnapshot(matching: parent.view, as: .image, named: "lang_\(language)_device_\(device)")
}
}
}
Expand Down Expand Up @@ -176,7 +177,7 @@ internal final class ActivitiesViewControllerTests: TestCase {

self.scheduler.run()

FBSnapshotVerifyView(vc.view, identifier: "lang_\(language)_device_\(device)")
assertSnapshot(matching: parent.view, as: .image, named: "lang_\(language)_device_\(device)")
}
}
}
Expand Down Expand Up @@ -211,7 +212,7 @@ internal final class ActivitiesViewControllerTests: TestCase {

self.scheduler.run()

FBSnapshotVerifyView(vc.view, identifier: "lang_\(language)_device_\(device)")
assertSnapshot(matching: parent.view, as: .image, named: "lang_\(language)_device_\(device)")
}
}
}
Expand Down Expand Up @@ -243,7 +244,7 @@ internal final class ActivitiesViewControllerTests: TestCase {

self.scheduler.run()

FBSnapshotVerifyView(vc.view, identifier: "lang_\(language)_device_\(device)")
assertSnapshot(matching: parent.view, as: .image, named: "lang_\(language)_device_\(device)")
}
}
}
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@testable import KsApi
@testable import Library
import Prelude
import SnapshotTesting
import UIKit

/** FIXME: There is a problem with testing the payment sheet. Somehow SPM is incorrectly linking the SDK resources explained here:
Expand All @@ -23,7 +24,7 @@ final class AddNewCardViewControllerTests: TestCase {
controller.configure(with: .settings)
let (parent, _) = traitControllers(device: device, orientation: .portrait, child: controller)

FBSnapshotVerifyView(parent.view, identifier: "lang_\(language)_device_\(device)")
assertSnapshot(matching: parent.view, as: .image, named: "lang_\(language)_device_\(device)")
}
}
}
Expand All @@ -35,7 +36,7 @@ final class AddNewCardViewControllerTests: TestCase {
controller.configure(with: .pledge)
let (parent, _) = traitControllers(device: device, orientation: .portrait, child: controller)

FBSnapshotVerifyView(parent.view, identifier: "lang_\(language)_device_\(device)")
assertSnapshot(matching: parent.view, as: .image, named: "lang_\(language)_device_\(device)")
}
}
}
Expand All @@ -53,7 +54,7 @@ final class AddNewCardViewControllerTests: TestCase {
controller.configure(with: .settings)
let (parent, _) = traitControllers(device: device, orientation: .portrait, child: controller)

FBSnapshotVerifyView(parent.view, identifier: "locale_\(locale)_device_\(device)")
assertSnapshot(matching: parent.view, as: .image, named: "lang_\(locale)_device_\(device)")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@testable import KsApi
@testable import Library
import Prelude
import SnapshotTesting
import XCTest

internal final class BackerDashboardProjectsViewControllerTests: TestCase {
Expand Down Expand Up @@ -67,7 +68,7 @@ internal final class BackerDashboardProjectsViewControllerTests: TestCase {
)
self.scheduler.run()

FBSnapshotVerifyView(parent.view, identifier: "lang_\(language)_device_\(device)")
assertSnapshot(matching: parent.view, as: .image, named: "lang_\(language)_device_\(device)")
}
}
}
Expand All @@ -90,7 +91,7 @@ internal final class BackerDashboardProjectsViewControllerTests: TestCase {
)
self.scheduler.run()

FBSnapshotVerifyView(parent.view, identifier: "lang_\(language)_device_\(device)")
assertSnapshot(matching: parent.view, as: .image, named: "lang_\(language)_device_\(device)")
}
}
}
Expand All @@ -113,7 +114,7 @@ internal final class BackerDashboardProjectsViewControllerTests: TestCase {
)
self.scheduler.run()

FBSnapshotVerifyView(parent.view, identifier: "lang_\(language)_device_\(device)")
assertSnapshot(matching: parent.view, as: .image, named: "lang_\(language)_device_\(device)")
}
}
}
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@testable import KsApi
@testable import Library
import Prelude
import SnapshotTesting
import UIKit

final class BetaToolsViewControllerTests: TestCase {
Expand All @@ -26,7 +27,7 @@ final class BetaToolsViewControllerTests: TestCase {

self.scheduler.run()

FBSnapshotVerifyView(parent.view)
assertSnapshot(matching: parent.view, as: .image)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Foundation
@testable import Kickstarter_Framework
@testable import KsApi
@testable import Library
import SnapshotTesting
import XCTest

final class CancelPledgeViewControllerTests: TestCase {
Expand Down Expand Up @@ -35,7 +36,11 @@ final class CancelPledgeViewControllerTests: TestCase {
controller.configure(with: data)
let (parent, _) = traitControllers(device: device, orientation: .portrait, child: controller)

FBSnapshotVerifyView(parent.view, identifier: "lang_\(language)_device_\(device)")
assertSnapshot(
matching: parent.view,
as: .image(perceptualPrecision: 0.98),
named: "lang_\(language)_device_\(device)"
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@testable import Kickstarter_Framework
@testable import KsApi
@testable import Library
import SnapshotTesting
import XCTest

internal final class CategorySelectionViewControllerTests: TestCase {
Expand Down Expand Up @@ -32,7 +33,11 @@ internal final class CategorySelectionViewControllerTests: TestCase {

self.scheduler.run()

FBSnapshotVerifyView(parent.view, identifier: "lang_\(language)_device_\(device)")
assertSnapshot(
matching: parent.view,
as: .image(perceptualPrecision: 0.98),
named: "lang_\(language)_device_\(device)"
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@testable import KsApi
@testable import Library
import Prelude
import SnapshotTesting
import XCTest

final class ChangeEmailViewControllerTests: TestCase {
Expand Down Expand Up @@ -29,7 +30,7 @@ final class ChangeEmailViewControllerTests: TestCase {

scheduler.advance()

FBSnapshotVerifyView(parent.view, identifier: "lang_\(language)_device_\(device)")
assertSnapshot(matching: parent.view, as: .image, named: "lang_\(language)_device_\(device)")
}
}
}
Expand All @@ -45,7 +46,7 @@ final class ChangeEmailViewControllerTests: TestCase {

scheduler.advance()

FBSnapshotVerifyView(parent.view, identifier: "lang_\(language)_device_\(device)")
assertSnapshot(matching: parent.view, as: .image, named: "lang_\(language)_device_\(device)")
}
}
}
Expand All @@ -68,7 +69,7 @@ final class ChangeEmailViewControllerTests: TestCase {

scheduler.advance()

FBSnapshotVerifyView(parent.view, identifier: "lang_\(language)_device_\(device)")
assertSnapshot(matching: parent.view, as: .image, named: "lang_\(language)_device_\(device)")
}
}
}
Expand All @@ -86,7 +87,7 @@ final class ChangeEmailViewControllerTests: TestCase {

scheduler.advance()

FBSnapshotVerifyView(parent.view, identifier: "lang_\(language)_device_\(device)")
assertSnapshot(matching: parent.view, as: .image, named: "lang_\(language)_device_\(device)")
}
}
}
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@testable import KsApi
@testable import Library
import Prelude
import SnapshotTesting
import XCTest

final class ChangePasswordViewControllerTests: TestCase {
Expand All @@ -23,7 +24,7 @@ final class ChangePasswordViewControllerTests: TestCase {
let controller = ChangePasswordViewController.instantiate()
let (parent, _) = traitControllers(device: device, orientation: .portrait, child: controller)

FBSnapshotVerifyView(parent.view, identifier: "lang_\(language)_device_\(device)")
assertSnapshot(matching: parent.view, as: .image, named: "lang_\(language)_device_\(device)")
}
}
}
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@testable import KsApi
import Library
import Prelude
import SnapshotTesting
import XCTest

final class CommentRepliesViewControllerTests: TestCase {
Expand Down Expand Up @@ -40,7 +41,11 @@ final class CommentRepliesViewControllerTests: TestCase {

self.scheduler.run()

FBSnapshotVerifyView(parent.view, identifier: "CommentReplies - lang_\(language)_device_\(device)")
assertSnapshot(
matching: parent.view,
as: .image,
named: "CommentReplies - lang_\(language)_device_\(device)"
)
}
}
}
Expand Down Expand Up @@ -70,7 +75,11 @@ final class CommentRepliesViewControllerTests: TestCase {
parent.view.frame.size.height = 1_100

self.scheduler.run()
FBSnapshotVerifyView(parent.view, identifier: "CommentReplies - lang_\(language)_device_\(device)")
assertSnapshot(
matching: parent.view,
as: .image,
named: "CommentReplies - lang_\(language)_device_\(device)"
)
}
}
}
Expand Down Expand Up @@ -100,7 +109,11 @@ final class CommentRepliesViewControllerTests: TestCase {
parent.view.frame.size.height = 1_100

self.scheduler.run()
FBSnapshotVerifyView(parent.view, identifier: "CommentReplies - lang_\(language)_device_\(device)")
assertSnapshot(
matching: parent.view,
as: .image,
named: "CommentReplies - lang_\(language)_device_\(device)"
)
}
}
}
Expand Down Expand Up @@ -132,7 +145,11 @@ final class CommentRepliesViewControllerTests: TestCase {

self.scheduler.run()

FBSnapshotVerifyView(parent.view, identifier: "CommentReplies - lang_\(language)_device_\(device)")
assertSnapshot(
matching: parent.view,
as: .image,
named: "CommentReplies - lang_\(language)_device_\(device)"
)
}
}
}
Expand Down Expand Up @@ -166,7 +183,11 @@ final class CommentRepliesViewControllerTests: TestCase {

self.scheduler.advance()

FBSnapshotVerifyView(parent.view, identifier: "CommentReplies - lang_\(language)_device_\(device)")
assertSnapshot(
matching: parent.view,
as: .image,
named: "CommentReplies - lang_\(language)_device_\(device)"
)
}
}
}
Expand Down Expand Up @@ -196,7 +217,11 @@ final class CommentRepliesViewControllerTests: TestCase {

self.scheduler.advance()

FBSnapshotVerifyView(parent.view, identifier: "CommentReplies - lang_\(language)_device_\(device)")
assertSnapshot(
matching: parent.view,
as: .image,
named: "CommentReplies - lang_\(language)_device_\(device)"
)
}
}
}
Expand Down
Loading