diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index c295e98df..e6a6b6e1b 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -4,7 +4,7 @@ on: push: branches: [ "main" ] pull_request: - branches: [ "main", "next" ] + branches: [ "main", "next", "feature/image-manager-tests" ] jobs: coverage: diff --git a/Tests/SnappThemingTests/Mocks/MockExternalProcessor.swift b/Tests/SnappThemingTests/Mocks/MockExternalProcessor.swift index 1e373d3d3..92dca540b 100644 --- a/Tests/SnappThemingTests/Mocks/MockExternalProcessor.swift +++ b/Tests/SnappThemingTests/Mocks/MockExternalProcessor.swift @@ -10,8 +10,7 @@ import SnappTheming import UniformTypeIdentifiers final class MockExternalProcessor: SnappThemingExternalImageProcessorProtocol { - let dummyImage = SnappThemingImage(systemSymbolName: "pencil", accessibilityDescription: "test") func process(_ object: SnappTheming.SnappThemingImageObject, of type: UTType) -> SnappThemingImage? { - dummyImage + SnappThemingImage(systemSymbolName: "pencil", accessibilityDescription: "test") } } diff --git a/Tests/SnappThemingTests/SnappThemingImageManagerTests.swift b/Tests/SnappThemingTests/SnappThemingImageManagerTests.swift index 9528522c2..c3132d811 100644 --- a/Tests/SnappThemingTests/SnappThemingImageManagerTests.swift +++ b/Tests/SnappThemingTests/SnappThemingImageManagerTests.swift @@ -51,6 +51,7 @@ struct SnappThemingImageManagerTests { @Test func testPreparingImage_External() throws { let mock = MockExternalProcessor() + let mockImage = SnappThemingImage(systemSymbolName: "pencil", accessibilityDescription: "test") SnappThemingImageProcessorsRegistry.shared.register(mock) let manager: SnappThemingImageManager = SnappThemingImageManagerDefault( .withFileExistTrue, @@ -66,7 +67,7 @@ struct SnappThemingImageManagerTests { #expect(object.url == nil) #expect(object.data == dataURI.data) let image = try #require(manager.image(from: object, of: dataURI.type)) - #expect(image.size == mock.dummyImage?.size) + #expect(image.size == mockImage?.size) SnappThemingImageProcessorsRegistry.shared.unregister(MockExternalProcessor.self) }