From 9e60ac2f3370aeca07b42889c1574978ecdd0530 Mon Sep 17 00:00:00 2001 From: Aleksei Kakoulin Date: Tue, 18 Jan 2022 09:25:49 +0300 Subject: [PATCH] Update SnapshotTestingStitchHEIC --- .../SnapshotTestingStitchHEIC.swift | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/Tests/SnapshotTestingStitchTests/SnapshotTestingStitchHEIC.swift b/Tests/SnapshotTestingStitchTests/SnapshotTestingStitchHEIC.swift index c0c3ceb..1f19b56 100644 --- a/Tests/SnapshotTestingStitchTests/SnapshotTestingStitchHEIC.swift +++ b/Tests/SnapshotTestingStitchTests/SnapshotTestingStitchHEIC.swift @@ -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 ) @@ -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 ) @@ -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 ) @@ -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)), @@ -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 ) @@ -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 ) @@ -85,7 +90,7 @@ final class SnapshotTestingStitchHEICTests: XCTestCase { assertSnapshot( matching: createTestView(), - as: .stitchHEIC(strategies: tasks), + as: .stitch(strategies: tasks, format: .heic()), record: isRecording ) } @@ -93,18 +98,19 @@ final class SnapshotTestingStitchHEICTests: XCTestCase { 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 {