Skip to content

Commit

Permalink
Fix test bulid
Browse files Browse the repository at this point in the history
  • Loading branch information
akaDuality committed Jan 2, 2024
1 parent f64b966 commit 3f934fb
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,9 @@ class CanvasScrollViewSpy: CanvasScrollViewProtocol {

}
}

extension CanvasPresenter {
func add(image: NSImage) {
add(image: image, name: "Sample")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3f934fb

Please sign in to comment.