Skip to content

Commit 2341f8a

Browse files
committed
Update tests for gap and remove tests for getGap
1 parent 70afd70 commit 2341f8a

File tree

1 file changed

+7
-59
lines changed

1 file changed

+7
-59
lines changed

Tests/FlexLayoutTests/WidthSizeContentTests.swift

Lines changed: 7 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -164,100 +164,48 @@ final class WidthSizeContentTests: XCTestCase {
164164
XCTAssertEqual(aView.frame, CGRect(x: 0.0, y: 0.0, width: 400.0, height: 200.0))
165165
}
166166

167-
func test_set_gap_in_row_direction() {
167+
func test_row_gap() {
168168
rootFlexContainer.flex.direction(.row).define { flex in
169169
flex.addItem(aView).height(100).width(100)
170170
flex.addItem(bView).height(100).width(100)
171171
flex.alignItems(.start)
172172

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

176176
rootFlexContainer.flex.layout()
177177
XCTAssertEqual(bView.frame, CGRect(x: 150.0, y: 0.0, width: 100.0, height: 100.0))
178178
}
179179

180-
func test_set_gap_in_column_direction() {
180+
func test_column_gap() {
181181
rootFlexContainer.flex.direction(.column).define { flex in
182182
flex.addItem(aView).height(100).width(100)
183183
flex.addItem(bView).height(100).width(100)
184184
flex.alignItems(.start)
185185

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

189189
rootFlexContainer.flex.layout()
190190
XCTAssertEqual(bView.frame, CGRect(x: 0.0, y: 150.0, width: 100.0, height: 100.0))
191191
}
192192

193-
func test_set_gap_in_all_direction() {
193+
func test_gap() {
194194
rootFlexContainer.flex.direction(.column).define { flex in
195195
flex.addItem().direction(.row).define { flex in
196196
flex.addItem(aView).height(100).width(100)
197197
flex.addItem(bView).height(100).width(100)
198-
flex.setGap(.all, 50)
198+
flex.gap(50)
199199
}
200200
flex.addItem(cView).height(100).width(100)
201201

202202
flex.alignItems(.start)
203-
flex.setGap(.all, 50)
203+
flex.gap(50)
204204
}
205205

206206
rootFlexContainer.flex.layout()
207207

208208
XCTAssertEqual(bView.frame, CGRect(x: 150.0, y: 0.0, width: 100.0, height: 100.0))
209209
XCTAssertEqual(cView.frame, CGRect(x: 0.0, y: 150.0, width: 100.0, height: 100.0))
210210
}
211-
212-
func test_get_gap_in_row_direction() {
213-
rootFlexContainer.flex.direction(.row).define { flex in
214-
flex.addItem(aView).height(100).width(100)
215-
flex.addItem(bView).height(100).width(100)
216-
flex.alignItems(.start)
217-
218-
flex.setGap(.row, 20)
219-
}
220-
221-
rootFlexContainer.flex.layout()
222-
223-
let rowGap = rootFlexContainer.flex.getGap(.row)
224-
225-
XCTAssertEqual(rowGap, 20)
226-
}
227-
228-
func test_get_gap_in_column_direction() {
229-
rootFlexContainer.flex.direction(.column).define { flex in
230-
flex.addItem(aView).height(100).width(100)
231-
flex.addItem(bView).height(100).width(100)
232-
flex.alignItems(.start)
233-
234-
flex.setGap(.column, 20)
235-
}
236-
237-
rootFlexContainer.flex.layout()
238-
239-
let columnGap = rootFlexContainer.flex.getGap(.column)
240-
241-
XCTAssertEqual(columnGap, 20)
242-
}
243-
244-
func test_get_gap_in_all_direction() {
245-
rootFlexContainer.flex.direction(.column).define { flex in
246-
flex.addItem().direction(.row).define { flex in
247-
flex.addItem(aView).height(100).width(100)
248-
flex.addItem(bView).height(100).width(100)
249-
flex.setGap(.all, 20)
250-
}
251-
flex.addItem(cView).height(100).width(100)
252-
253-
flex.alignItems(.start)
254-
flex.setGap(.all, 20)
255-
}
256-
257-
rootFlexContainer.flex.layout()
258-
259-
let allGap = rootFlexContainer.flex.getGap(.all)
260-
261-
XCTAssertEqual(allGap, 20)
262-
}
263211
}

0 commit comments

Comments
 (0)