20 lines
817 B
Swift
20 lines
817 B
Swift
import HelderCore
|
|
import Testing
|
|
|
|
@Suite struct ColumnLayoutTests {
|
|
@Test func roomyWindowUsesTheDesignRatios() {
|
|
let w = ColumnLayout.fluid(windowWidth: 1760, focus: .terminal)
|
|
#expect(w == ColumnWidths(sourceControl: 236, explorer: 289, agent: 480))
|
|
}
|
|
|
|
@Test func tightWindowFollowsFocus() {
|
|
#expect(ColumnLayout.fluid(windowWidth: 1200, focus: .terminal).agent == 600)
|
|
#expect(ColumnLayout.fluid(windowWidth: 1200, focus: .editor).agent == 240)
|
|
}
|
|
|
|
@Test func fittingKeepsTheEditorMinimum() {
|
|
let fitted = ColumnLayout.fitted(ColumnWidths(sourceControl: 400, explorer: 400, agent: 400), windowWidth: 1000, sourceControlVisible: true)
|
|
#expect(fitted.sourceControl + fitted.explorer + fitted.agent <= 1000 - 3 - ColumnLayout.minEditorWidth)
|
|
}
|
|
}
|