Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
NickEntin committed Aug 29, 2024
1 parent cc36157 commit 5eb1e62
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions ParalayoutTests/DistributionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,26 @@ final class DistributionTests: XCTestCase {
}
}

// MARK: - Tests - Spacers

@MainActor
func testZeroSizeFixedSpacer() {
let container = UIView(frame: .init(x: 0, y: 0, width: 100, height: 400))
container.semanticContentAttribute = .forceRightToLeft

let firstSubview = UIView(frame: .init(x: 0, y: 0, width: 100, height: 100))
container.addSubview(firstSubview)
let secondSubview = UIView(frame: .init(x: 0, y: 0, width: 100, height: 100))
container.addSubview(secondSubview)

container.applyVerticalSubviewDistribution {
firstSubview
0.fixed
secondSubview
}

XCTAssertEqual(firstSubview.frame, .init(x: 0, y: 100, width: 100, height: 100))
XCTAssertEqual(secondSubview.frame, .init(x: 0, y: 200, width: 100, height: 100))
}

}

0 comments on commit 5eb1e62

Please sign in to comment.