@@ -63,6 +63,22 @@ final class InsetTests: XCTestCase {
63
63
XCTAssertEqual ( aView. frame, CGRect ( x: 0.0 , y: - 10.0 , width: 400.0 , height: 400.0 ) )
64
64
}
65
65
66
+ func test_adjust_the_aView_size_and_relative_position_with_start( ) {
67
+ rootFlexContainer. flex. define { flex in
68
+ flex. addItem ( aView) . position ( . relative) . grow ( 1 ) . start ( 10 )
69
+ }
70
+ rootFlexContainer. flex. layout ( )
71
+ XCTAssertEqual ( aView. frame, CGRect ( x: 10.0 , y: 0.0 , width: 400.0 , height: 400.0 ) )
72
+ }
73
+
74
+ func test_adjust_the_aView_size_and_relative_position_with_end( ) {
75
+ rootFlexContainer. flex. define { flex in
76
+ flex. addItem ( aView) . position ( . relative) . grow ( 1 ) . end ( 10 )
77
+ }
78
+ rootFlexContainer. flex. layout ( )
79
+ XCTAssertEqual ( aView. frame, CGRect ( x: - 10.0 , y: 0.0 , width: 400.0 , height: 400.0 ) )
80
+ }
81
+
66
82
func test_adjust_the_aView_size_and_relative_position_with_horizontally( ) {
67
83
rootFlexContainer. flex. define { flex in
68
84
flex. addItem ( aView) . position ( . relative) . grow ( 1 ) . horizontally ( 10 )
@@ -79,6 +95,14 @@ final class InsetTests: XCTestCase {
79
95
XCTAssertEqual ( aView. frame, CGRect ( x: 0.0 , y: 10.0 , width: 400.0 , height: 400.0 ) )
80
96
}
81
97
98
+ func test_adjust_the_aView_size_and_relative_position_with_all( ) {
99
+ rootFlexContainer. flex. define { flex in
100
+ flex. addItem ( aView) . position ( . relative) . grow ( 1 ) . all ( 10 )
101
+ }
102
+ rootFlexContainer. flex. layout ( )
103
+ XCTAssertEqual ( aView. frame, CGRect ( x: 10.0 , y: 10.0 , width: 400.0 , height: 400.0 ) )
104
+ }
105
+
82
106
func test_adjust_the_aView_size_absolute_position_with_left_right( ) {
83
107
rootFlexContainer. flex. define { flex in
84
108
flex. addItem ( aView) . position ( . absolute) . left ( 10 ) . right ( 10 ) . width ( 300 ) . height ( 200 )
@@ -88,7 +112,7 @@ final class InsetTests: XCTestCase {
88
112
XCTAssertEqual ( aView. frame, CGRect ( x: 10.0 , y: 0.0 , width: 300.0 , height: 200.0 ) )
89
113
}
90
114
91
- func test_adjust_the_aView_size_absolute_position_with_right ( ) {
115
+ func test_adjust_the_aView_size_absolute_position_with_right_and_reset_left_later ( ) {
92
116
rootFlexContainer. flex. define { flex in
93
117
flex. addItem ( aView) . position ( . absolute) . left ( 10 ) . right ( 10 ) . width ( 300 ) . height ( 200 )
94
118
}
@@ -108,7 +132,7 @@ final class InsetTests: XCTestCase {
108
132
XCTAssertEqual ( aView. frame, CGRect ( x: 15.0 , y: 20.0 , width: 370.0 , height: 360.0 ) )
109
133
}
110
134
111
- func test_adjust_the_aView_size_absolute_position_with_horizontally_all ( ) {
135
+ func test_adjust_the_aView_size_absolute_position_with_all ( ) {
112
136
rootFlexContainer. flex. define { flex in
113
137
flex. addItem ( aView) . position ( . absolute) . all ( 45 )
114
138
}
@@ -149,6 +173,22 @@ final class InsetTests: XCTestCase {
149
173
XCTAssertEqual ( aView. frame, CGRect ( x: 0.0 , y: 0.0 , width: 400.0 , height: 400.0 ) )
150
174
}
151
175
176
+ func test_adjust_the_aView_size_and_static_position_with_start( ) {
177
+ rootFlexContainer. flex. define { flex in
178
+ flex. addItem ( aView) . position ( . static) . grow ( 1 ) . start ( 10 )
179
+ }
180
+ rootFlexContainer. flex. layout ( )
181
+ XCTAssertEqual ( aView. frame, CGRect ( x: 0.0 , y: 0.0 , width: 400.0 , height: 400.0 ) )
182
+ }
183
+
184
+ func test_adjust_the_aView_size_and_static_position_with_end( ) {
185
+ rootFlexContainer. flex. define { flex in
186
+ flex. addItem ( aView) . position ( . static) . grow ( 1 ) . end ( 10 )
187
+ }
188
+ rootFlexContainer. flex. layout ( )
189
+ XCTAssertEqual ( aView. frame, CGRect ( x: 0.0 , y: 0.0 , width: 400.0 , height: 400.0 ) )
190
+ }
191
+
152
192
func test_adjust_the_aView_size_and_static_position_with_horizontally( ) {
153
193
rootFlexContainer. flex. define { flex in
154
194
flex. addItem ( aView) . position ( . static) . grow ( 1 ) . horizontally ( 10 )
@@ -164,4 +204,12 @@ final class InsetTests: XCTestCase {
164
204
rootFlexContainer. flex. layout ( )
165
205
XCTAssertEqual ( aView. frame, CGRect ( x: 0.0 , y: 0.0 , width: 400.0 , height: 400.0 ) )
166
206
}
207
+
208
+ func test_adjust_the_aView_size_and_static_position_with_all( ) {
209
+ rootFlexContainer. flex. define { flex in
210
+ flex. addItem ( aView) . position ( . static) . grow ( 1 ) . all ( 10 )
211
+ }
212
+ rootFlexContainer. flex. layout ( )
213
+ XCTAssertEqual ( aView. frame, CGRect ( x: 0.0 , y: 0.0 , width: 400.0 , height: 400.0 ) )
214
+ }
167
215
}
0 commit comments