Skip to content

Commit

Permalink
Update SnapshotTestingStitchHEIC
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey1312 committed Jan 18, 2022
1 parent 4156600 commit 9e60ac2
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions Tests/SnapshotTestingStitchTests/SnapshotTestingStitchHEIC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ final class SnapshotTestingStitchHEICTests: XCTestCase {
func test_withTitles() {
assertSnapshot(
matching: createTestViewController(),
as: .stitchHEIC(
as: .stitch(
strategies: [
("iPhone 8", .image(on: .iPhone8)),
("iPhone 8 Plus", .image(on: .iPhone8Plus)),
]
],
format: .heic()
),
record: isRecording
)
Expand All @@ -23,11 +24,12 @@ final class SnapshotTestingStitchHEICTests: XCTestCase {
func test_withoutTitles() {
assertSnapshot(
matching: createTestViewController(),
as: .stitchHEIC(
as: .stitch(
strategies: [
.image(on: .iPhone8),
.image(on: .iPhone8Plus),
]
],
format: .heic()
),
record: isRecording
)
Expand All @@ -36,12 +38,13 @@ final class SnapshotTestingStitchHEICTests: XCTestCase {
func test_withoutBorder() {
assertSnapshot(
matching: createTestViewController(),
as: .stitchHEIC(
as: .stitch(
strategies: [
("iPhone 8", .image(on: .iPhone8)),
("iPhone 8 Plus", .image(on: .iPhone8Plus)),
],
style: .init(borderWidth: 0)
style: .init(borderWidth: 0),
format: .heic()
),
record: isRecording
)
Expand All @@ -50,7 +53,7 @@ final class SnapshotTestingStitchHEICTests: XCTestCase {
func test_withManyDevices() {
assertSnapshot(
matching: createTestViewController(),
as: .stitchHEIC(
as: .stitch(
strategies: [
("iPhone 8", .image(on: .iPhone8)),
("iPhone 8 Plus", .image(on: .iPhone8Plus)),
Expand All @@ -59,7 +62,8 @@ final class SnapshotTestingStitchHEICTests: XCTestCase {
("iPhone Xr", .image(on: .iPhoneXr)),
("iPhone Xs Max", .image(on: .iPhoneXsMax)),
("iPhone Xs Max (Landscape)", .image(on: .iPhoneXsMax(.landscape))),
]
],
format: .heic()
),
record: isRecording
)
Expand All @@ -68,11 +72,12 @@ final class SnapshotTestingStitchHEICTests: XCTestCase {
func test_withView() {
assertSnapshot(
matching: createTestView(),
as: .stitchHEIC(
as: .stitch(
strategies: [
("100x", .image(size: CGSize(width: 100, height: 100))),
("250x", .image(size: CGSize(width: 250, height: 250))),
]
],
format: .heic()
),
record: isRecording
)
Expand All @@ -85,26 +90,27 @@ final class SnapshotTestingStitchHEICTests: XCTestCase {

assertSnapshot(
matching: createTestView(),
as: .stitchHEIC(strategies: tasks),
as: .stitch(strategies: tasks, format: .heic()),
record: isRecording
)
}

func test_withConfigure() {
assertSnapshot(
matching: createTestViewController(),
as: .stitchHEIC(strategies: [
as: .stitch(strategies: [
.init(name: "Green", strategy: .image, configure: { $0.view.backgroundColor = .green }),
.init(name: "Pink", strategy: .image, configure: { $0.view.backgroundColor = .systemPink }),

// The input value is being manipulated, which means if you don't reconfigure it then it will be the
// same as the previous test.
.init(name: "Pink (No Configure)", strategy: .image, configure: nil),
]),
.init(name: "Pink (No Configure)", strategy: .image, configure: nil),
],
format: .heic()
),
record: isRecording
)
}

// MARK: - Helpers

func createTestViewController() -> UIViewController {
Expand Down

0 comments on commit 9e60ac2

Please sign in to comment.