Skip to content

Commit 1d85c13

Browse files
committed
Update unit test for CommentAttachmentRenderer to separate the cases
1 parent 82bf8f2 commit 1d85c13

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

AztecTests/Renderers/CommentAttachmentRendererTests.swift

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,20 @@ class CommentAttachmentRendererTests: XCTestCase {
5555
let renderer = CommentAttachmentRenderer(font: .systemFont(ofSize: 12))
5656

5757
// When
58-
let image = renderer.textView(textView, imageFor: gutenbergComment, with: .init(width: -1, height: -1))
58+
let image = renderer.textView(textView, imageFor: gutenbergComment, with: .init(width: 2, height: 2))
59+
60+
// Then
61+
XCTAssertNil(image)
62+
}
63+
64+
func testRenderingImageWithIllegalSizeReturnsNil() {
65+
// Given
66+
let textView = TextViewStub()
67+
let attachment = CommentAttachment()
68+
let renderer = CommentAttachmentRenderer(font: .systemFont(ofSize: 12))
69+
70+
// When
71+
let image = renderer.textView(textView, imageFor: attachment, with: .init(width: -1, height: -1))
5972

6073
// Then
6174
XCTAssertNil(image)

0 commit comments

Comments
 (0)