Skip to content

Commit

Permalink
Added test for VStack line spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
tevelee committed Aug 14, 2024
1 parent e19b92c commit 9f7e921
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Tests/FlowTests/FlowTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,28 @@ final class FlowTests: XCTestCase {
""")
}

func test_VFlow_size_singleElement() throws {
// Given
let sut: FlowLayout = .vertical(alignment: .center, itemSpacing: 10, lineSpacing: 20)

// When
let size = sut.sizeThatFits(proposal: 100×100, subviews: [50×50])

// Then
XCTAssertEqual(size, 50×50)
}

func test_VFlow_size_multipleElements() throws {
// Given
let sut: FlowLayout = .vertical(alignment: .center, itemSpacing: 10, lineSpacing: 20)

// When
let size = sut.sizeThatFits(proposal: 130×130, subviews: repeated(50×50, times: 3))

// Then
XCTAssertEqual(size, 120×110)
}

func test_VFlow_layout_leading() {
// Given
let sut: FlowLayout = .vertical(alignment: .leading, itemSpacing: 1, lineSpacing: 1)
Expand Down

0 comments on commit 9f7e921

Please sign in to comment.