Skip to content

Commit f5306f3

Browse files
author
Luc Dion
committed
Fix unit tests display scale
1 parent 51578ed commit f5306f3

File tree

6 files changed

+26
-1
lines changed

6 files changed

+26
-1
lines changed

Tests/Common/AdjustSizeSpec.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ class AdjustSizeSpec: QuickSpec {
7474
bViewChild.frame = CGRect(x: 40, y: 10, width: 60, height: 20)
7575
}
7676

77+
afterEach {
78+
_pinlayoutSetUnitTest(scale: nil)
79+
}
80+
7781
describe("the result of the width(...) methods") {
7882
it("should adjust the width of aView") {
7983
aView.pin.width(35)
@@ -858,6 +862,8 @@ class AdjustSizeSpec: QuickSpec {
858862
}
859863

860864
it("should produce the same size as the built-in sizeToFit() method") {
865+
_pinlayoutSetUnitTest(scale: 3)
866+
861867
let label = PLabel(frame: CGRect.zero)
862868
label.text = "Lorem ipsum dolor sit amet"
863869
label.pin.sizeToFit()
@@ -868,6 +874,8 @@ class AdjustSizeSpec: QuickSpec {
868874
}
869875

870876
it("should produce the same size as the built-in sizeToFit() method when there is a transform applied") {
877+
_pinlayoutSetUnitTest(scale: 3)
878+
871879
let label = PLabel(frame: CGRect.zero)
872880
label.text = "Lorem ipsum dolor sit amet"
873881
label.transform = CGAffineTransform(scaleX: 0.5, y: 0.5)

Tests/Common/JustifyAlignSpec.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ class JustifyAlignSpec: QuickSpec {
4949
aView.sizeThatFitsExpectedArea = 40 * 40
5050
rootView.addSubview(aView)
5151
}
52+
53+
afterEach {
54+
_pinlayoutSetUnitTest(scale: nil)
55+
}
5256

5357
//
5458
// justify + warning

Tests/Common/LayoutMethodSpec.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ class LayoutMethodSpec: QuickSpec {
4949
aView.frame = CGRect(x: 40, y: 100, width: 100, height: 60)
5050
rootView.addSubview(aView)
5151
}
52-
52+
5353
afterEach {
54+
_pinlayoutSetUnitTest(scale: nil)
5455
Pin.logMissingLayoutCalls = false
5556
}
5657

Tests/Common/MinMaxWidthHeightSpec.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ class MinMaxWidthHeightSpec: QuickSpec {
5050
rootView.addSubview(aView)
5151
}
5252

53+
afterEach {
54+
_pinlayoutSetUnitTest(scale: nil)
55+
}
56+
5357
//
5458
// minWidth
5559
//

Tests/Common/WarningSpec.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ class WarningSpec: QuickSpec {
4949
aView.sizeThatFitsExpectedArea = 40 * 40
5050
rootView.addSubview(aView)
5151
}
52+
53+
afterEach {
54+
_pinlayoutSetUnitTest(scale: nil)
55+
}
5256

5357
//
5458
// pinEdges warnings

Tests/Common/WrapContentSpec.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ class WrapContentSpec: QuickSpec {
6666
rootView.frame = CGRect(x: 0, y: 100, width: 400, height: 400)
6767
}
6868

69+
afterEach {
70+
_pinlayoutSetUnitTest(scale: nil)
71+
}
72+
6973
describe("wrapContent") {
7074
it("wrap and update subviews position") {
7175
aView.frame = CGRect(x: 20, y: 10, width: 200, height: 100)

0 commit comments

Comments
 (0)