Skip to content

Commit df55d47

Browse files
committed
test(nsview): set size to fixed value
1 parent c3f2b91 commit df55d47

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Tests/SnapshotTestingTests/SnapshotTestingTests.swift

+4-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,10 @@ final class SnapshotTestingTests: XCTestCase {
248248
button.appearance = NSAppearance(named: .aqua)
249249
assertSnapshot(
250250
matching: button,
251-
as: .image(windowForDrawing: .init(backingScaleFactor: 1, colorSpace: .genericRGB))
251+
as: .image(
252+
size: .init(width: 84, height: 32),
253+
windowForDrawing: .init(backingScaleFactor: 1, colorSpace: .genericRGB)
254+
)
252255
)
253256
assertSnapshot(matching: button, as: .recursiveDescription)
254257
#endif
Loading
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[ AF ! U ] h=--- v=--- NSButton "Push Me" f=(0,0,83,32) b=(-)
2-
[ A ! U ] h=--- v=--- NSButtonBezelView f=(0,0,83,32) b=(-)
3-
[ AF ! U ] h=--- v=--- NSButtonTextField "Push Me" f=(11,7,61,15) b=(-)
1+
[ AF ! LU ] h=--- v=--- NSButton "Push Me" f=(0,0,83,32) b=(-)
2+
[ A ! U ] h=--- v=--- NSButtonBezelView f=(0,0,84,32) b=(-)
3+
[ AF ! U ] h=--- v=--- NSButtonTextField "Push Me" f=(11,7,62,15) b=(-)
44
A=autoresizesSubviews, C=canDrawConcurrently, D=needsDisplay, F=flipped, G=gstate, H=hidden (h=by ancestor), L=needsLayout (l=child needsLayout), U=needsUpdateConstraints (u=child needsUpdateConstraints), O=opaque, P=preservesContentDuringLiveResize, S=scaled/rotated, W=wantsLayer (w=ancestor wantsLayer), V=needsVibrancy (v=allowsVibrancy), #=has surface

0 commit comments

Comments
 (0)