From 2580b44f912f22fff684fab948115c2c976bdbf1 Mon Sep 17 00:00:00 2001 From: Paul Zabelin Date: Sun, 29 May 2022 02:56:14 -0700 Subject: [PATCH] use view name for activity --- Sources/verifySnapshot.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/verifySnapshot.swift b/Sources/verifySnapshot.swift index b9415c7..580f8b6 100644 --- a/Sources/verifySnapshot.swift +++ b/Sources/verifySnapshot.swift @@ -42,7 +42,8 @@ public func verifySnapshot(_ view: V, _ name: String? = nil, colorAccur XCTFail("failed to get image data") return } - let fileName = (name ?? "\(V.self)") + ".png" + let viewName = name ?? "\(V.self)" + let fileName = viewName + ".png" let url = folderUrl(String(describing: file)).appendingPathComponent(fileName) func writeActual(onFailure: String) { @@ -53,7 +54,7 @@ public func verifySnapshot(_ view: V, _ name: String? = nil, colorAccur } if let expectedData = try? Data(contentsOf: url), let expectedImage = UIImage(data: expectedData) { - XCTContext.runActivity(named: "compare images") { + XCTContext.runActivity(named: viewName) { let actualImage = XCTAttachment(data: pngData, uniformTypeIdentifier: UTType.png.identifier) actualImage.name = "actual image" $0.add(actualImage)