27 lines
1016 B
Swift
27 lines
1016 B
Swift
import CoreGraphics
|
|
@testable import HelderUI
|
|
import Testing
|
|
|
|
@Suite struct GitStripLayoutTests {
|
|
@Test func aNarrowStripSplitsEvenlyWithoutTheCommitList() {
|
|
let layout = GitStripLayout(width: 1201)
|
|
#expect(layout.console == 600)
|
|
#expect(layout.branches == 600)
|
|
#expect(layout.commits == nil)
|
|
}
|
|
|
|
@Test func bothPanelsStopAt820AndASmallRestStaysEmpty() {
|
|
let layout = GitStripLayout(width: 1800)
|
|
#expect(layout.console == GitMetrics.consoleMaxWidth)
|
|
#expect(layout.branches == GitMetrics.branchesMaxWidth)
|
|
#expect(layout.commits == nil)
|
|
}
|
|
|
|
@Test func theCommitListTakesTheRestFrom260() {
|
|
let edge = GitMetrics.consoleMaxWidth + GitMetrics.branchesMaxWidth + 2 + GitMetrics.commitsMinWidth
|
|
#expect(GitStripLayout(width: edge - 1).commits == nil)
|
|
#expect(GitStripLayout(width: edge).commits == GitMetrics.commitsMinWidth)
|
|
#expect(GitStripLayout(width: 2560).commits == CGFloat(2560 - 1640 - 2))
|
|
}
|
|
}
|