diff --git a/Shared/Tests/DocumentTests/Document/DocumentImage+ScaleTests.swift b/Shared/Tests/DocumentTests/Document/DocumentImage+ScaleTests.swift index 684ba4fb..8d5299db 100644 --- a/Shared/Tests/DocumentTests/Document/DocumentImage+ScaleTests.swift +++ b/Shared/Tests/DocumentTests/Document/DocumentImage+ScaleTests.swift @@ -46,7 +46,7 @@ final class DocumentImage_ScaleTests: XCTestCase { func test_APPKit_whenUpdateImageExternaly_shouldSetImageSizeWithScale() throws { let document = try VODesignDocument(type: uti) - document.addFrame(with: try imageWith3xScale(), origin: .zero) + document.addFrame(with: try imageWith3xScale(), name: "Sample", origin: .zero) let frame = try XCTUnwrap(document.artboard.frames.first) XCTAssertEqual( @@ -59,7 +59,7 @@ final class DocumentImage_ScaleTests: XCTestCase { func test_whenAddImage_shouldCreateFrameOfImageSize() throws { let document = try VODesignDocument(type: uti) - document.addFrame(with: try imageWith3xScale(), origin: .zero) + document.addFrame(with: try imageWith3xScale(), name: "Sample", origin: .zero) let frame = try XCTUnwrap(document.artboard.frames.first, "should create frame from image") XCTAssertEqual(frame.frame, CGRect(origin: .zero, size: scaledSize), "should use scaled frame") diff --git a/Shared/Tests/DocumentTests/Document/DocumentWrappersInvalidationTests.swift b/Shared/Tests/DocumentTests/Document/DocumentWrappersInvalidationTests.swift index cfecef1c..ae16868e 100644 --- a/Shared/Tests/DocumentTests/Document/DocumentWrappersInvalidationTests.swift +++ b/Shared/Tests/DocumentTests/Document/DocumentWrappersInvalidationTests.swift @@ -15,7 +15,7 @@ class DocumentWrappersInvalidationTests: XCTestCase { func test_documentWithImage_whenUpdateImage_shouldInvalidateQuickLookFile() throws { let document = try Sample().document(name: .artboard, testCase: self) - document.addFrame(with: Image(), origin: .zero) + document.addFrame(with: Image(), name: "Sample", origin: .zero) XCTAssertNil(document.frameWrappers[0][FolderName.quickLook], "quickLook is invalidated") } diff --git a/Shared/Tests/DocumentTests/Models/Order/DocumentPresenterTests+Inserting.swift b/Shared/Tests/DocumentTests/Models/Order/DocumentPresenterTests+Inserting.swift index 312d4ab1..a7e7a07e 100644 --- a/Shared/Tests/DocumentTests/Models/Order/DocumentPresenterTests+Inserting.swift +++ b/Shared/Tests/DocumentTests/Models/Order/DocumentPresenterTests+Inserting.swift @@ -139,7 +139,7 @@ final class DocumentPresenterTests_Inserting: XCTestCase { private func addFrameWithElement() throws { sut.disableUndoRegistration() - sut.add(image: Sample().image3x(), origin: .zero) + sut.add(image: Sample().image3x(), name: "Sample", origin: .zero) sut.append(control: A11yDescription.testMake(frame: CGRect(x: 0, y: 0, width: 20, height: 20))) sut.enableUndoRegistration() } diff --git a/Shared/Tests/DocumentTests/Models/Order/DocumentPresenterTests+Movement.swift b/Shared/Tests/DocumentTests/Models/Order/DocumentPresenterTests+Movement.swift index 58eb1dc5..4a22f7d8 100644 --- a/Shared/Tests/DocumentTests/Models/Order/DocumentPresenterTests+Movement.swift +++ b/Shared/Tests/DocumentTests/Models/Order/DocumentPresenterTests+Movement.swift @@ -44,7 +44,7 @@ class DocumentPresenterTests_Movement: XCTestCase { artboard = document.artboard sut.disableUndoRegistration() - sut.add(image: Sample().image3x(), origin: .zero) + sut.add(image: Sample().image3x(), name: "Test Frame", origin: .zero) frame = try XCTUnwrap(artboard.frames.first) frame.label = "Frame" @@ -413,7 +413,7 @@ Container: } func test_canNotInsertFrameInFrame() throws { - sut.add(image: Sample().image3x(), origin: .zero) + sut.add(image: Sample().image3x(), name: "Sample", origin: .zero) let frame2 = try XCTUnwrap(artboard.frames.last) frame2.label = "Frame 2" diff --git a/VoiceOver Designer/Features/Sources/Recent/RecentViewController/UI/DocumentsBrowserViewController.swift b/VoiceOver Designer/Features/Sources/Recent/RecentViewController/UI/DocumentsBrowserViewController.swift index 02bad768..0263fc87 100644 --- a/VoiceOver Designer/Features/Sources/Recent/RecentViewController/UI/DocumentsBrowserViewController.swift +++ b/VoiceOver Designer/Features/Sources/Recent/RecentViewController/UI/DocumentsBrowserViewController.swift @@ -68,7 +68,7 @@ extension DocumentsBrowserViewController: DragNDropDelegate { return true } - public func didDrag(image: NSImage, locationInWindow: CGPoint) { + public func didDrag(image: NSImage, locationInWindow: CGPoint, name: String?) { let document = VODesignDocument(image: image) show(document: document) } diff --git a/VoiceOver Designer/Features/Tests/CanvasAppKitTests/Base/CanvasPresenterTests.swift b/VoiceOver Designer/Features/Tests/CanvasAppKitTests/Base/CanvasPresenterTests.swift index 54f83f6b..ce1266f2 100644 --- a/VoiceOver Designer/Features/Tests/CanvasAppKitTests/Base/CanvasPresenterTests.swift +++ b/VoiceOver Designer/Features/Tests/CanvasAppKitTests/Base/CanvasPresenterTests.swift @@ -146,3 +146,9 @@ class CanvasScrollViewSpy: CanvasScrollViewProtocol { } } + +extension CanvasPresenter { + func add(image: NSImage) { + add(image: image, name: "Sample") + } +} diff --git a/VoiceOver Designer/Features/Tests/CanvasAppKitTests/NewDrawingTests.swift b/VoiceOver Designer/Features/Tests/CanvasAppKitTests/NewDrawingTests.swift index dfc100ac..97d41735 100644 --- a/VoiceOver Designer/Features/Tests/CanvasAppKitTests/NewDrawingTests.swift +++ b/VoiceOver Designer/Features/Tests/CanvasAppKitTests/NewDrawingTests.swift @@ -89,7 +89,7 @@ class NewDrawingTests: CanvasAfterDidLoadTests { func addFrame() { let image = Sample().image3x() - sut.add(image: image) + sut.add(image: image, name: "Sample") } // MARK: - Frame drawing