Skip to content

Commit 7196cb1

Browse files
committed
Update tests for getGap and setGap
1 parent 49d5607 commit 7196cb1

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

Tests/FlexLayoutTests/WidthSizeContentTests.swift

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ final class WidthSizeContentTests: XCTestCase {
170170
flex.addItem(bView).height(100).width(100)
171171
flex.alignItems(.start)
172172

173-
flex.setGap(.row, 50)
173+
flex.setGap(.column, 50)
174174
}
175175

176176
rootFlexContainer.flex.layout()
@@ -183,7 +183,7 @@ final class WidthSizeContentTests: XCTestCase {
183183
flex.addItem(bView).height(100).width(100)
184184
flex.alignItems(.start)
185185

186-
flex.setGap(.column, 50)
186+
flex.setGap(.row, 50)
187187
}
188188

189189
rootFlexContainer.flex.layout()
@@ -192,20 +192,21 @@ final class WidthSizeContentTests: XCTestCase {
192192

193193
func test_set_gap_in_all_direction() {
194194
rootFlexContainer.flex.direction(.column).define { flex in
195-
flex.addItem(aView).height(100).width(100)
196-
flex.addItem(bView).height(100).width(100)
197195
flex.addItem().direction(.row).define { flex in
198-
flex.addItem(cView).height(100).width(100)
196+
flex.addItem(aView).height(100).width(100)
197+
flex.addItem(bView).height(100).width(100)
198+
flex.setGap(.all, 50)
199199
}
200-
flex.alignItems(.start)
200+
flex.addItem(cView).height(100).width(100)
201201

202+
flex.alignItems(.start)
202203
flex.setGap(.all, 50)
203204
}
204205

205206
rootFlexContainer.flex.layout()
206207

207-
XCTAssertEqual(bView.frame, CGRect(x: 0.0, y: 150.0, width: 100.0, height: 100.0))
208-
XCTAssertEqual(cView.frame, CGRect(x: 150.0, y: 0.0, width: 100.0, height: 100.0))
208+
XCTAssertEqual(bView.frame, CGRect(x: 150.0, y: 0.0, width: 100.0, height: 100.0))
209+
XCTAssertEqual(cView.frame, CGRect(x: 0.0, y: 150.0, width: 100.0, height: 100.0))
209210
}
210211

211212
func test_get_gap_in_row_direction() {
@@ -242,16 +243,17 @@ final class WidthSizeContentTests: XCTestCase {
242243

243244
func test_get_gap_in_all_direction() {
244245
rootFlexContainer.flex.direction(.column).define { flex in
245-
flex.addItem(aView).height(100).width(100)
246-
flex.addItem(bView).height(100).width(100)
247246
flex.addItem().direction(.row).define { flex in
248-
flex.addItem(cView).height(100).width(100)
247+
flex.addItem(aView).height(100).width(100)
248+
flex.addItem(bView).height(100).width(100)
249+
flex.setGap(.all, 20)
249250
}
250-
flex.alignItems(.start)
251+
flex.addItem(cView).height(100).width(100)
251252

253+
flex.alignItems(.start)
252254
flex.setGap(.all, 20)
253255
}
254-
256+
255257
rootFlexContainer.flex.layout()
256258

257259
let allGap = rootFlexContainer.flex.getGap(.all)

0 commit comments

Comments
 (0)