Skip to content

Commit

Permalink
fixup! Add landscape snapshot testing capability
Browse files Browse the repository at this point in the history
This PR adds a capability to snapshot test screens in landscape, both
with regular and large font.

MOB-2653
  • Loading branch information
rasmustautsglia committed Sep 15, 2023
1 parent 7ed5771 commit fe018b2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions SnapshotTests/SnapshotTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ extension Snapshotting where Value == UIViewController, Format == UIImage {
.init(verticalSizeClass: .compact),
.init(preferredContentSizeCategory: .accessibilityExtraExtraExtraLarge)
])
let safeArea: UIEdgeInsets = .init(top: 0, left: 44, bottom: 24, right: 44)
let size: CGSize = .init(width: 896, height: 414)
let safeArea: UIEdgeInsets = .init(top: 0, left: 47, bottom: 21, right: 47)
let size: CGSize = .init(width: 844, height: 390)
let viewImageConfig: ViewImageConfig = .init(safeArea: safeArea, size: size, traits: traits)

return Self.image(on: viewImageConfig)
Expand All @@ -217,8 +217,8 @@ extension Snapshotting where Value == UIViewController, Format == UIImage {
.init(horizontalSizeClass: .regular),
.init(verticalSizeClass: .compact)
])
let safeArea: UIEdgeInsets = .init(top: 0, left: 44, bottom: 24, right: 44)
let size: CGSize = .init(width: 896, height: 414)
let safeArea: UIEdgeInsets = .init(top: 0, left: 47, bottom: 21, right: 47)
let size: CGSize = .init(width: 844, height: 390)
let viewImageConfig: ViewImageConfig = .init(safeArea: safeArea, size: size, traits: traits)

return Self.image(on: viewImageConfig)
Expand Down

0 comments on commit fe018b2

Please sign in to comment.