|
5 | 5 | */ |
6 | 6 |
|
7 | 7 | import { |
| 8 | + MIN_FULLSCREEN_ROWS_FOR_STATUS, |
8 | 9 | resolveStatusLineDisplay, |
9 | 10 | type StatusLineDisplayInput, |
| 11 | + statusRowFits, |
10 | 12 | } from './statusLineDisplay.js' |
11 | 13 |
|
12 | 14 | let passed = 0 |
@@ -125,6 +127,29 @@ test('assistant mode hides both rows whatever is configured', () => { |
125 | 127 | } |
126 | 128 | }) |
127 | 129 |
|
| 130 | +test('a short fullscreen terminal has no room for a status row', () => { |
| 131 | + assert( |
| 132 | + !statusRowFits(true, MIN_FULLSCREEN_ROWS_FOR_STATUS - 1), |
| 133 | + 'one row below the threshold should not fit', |
| 134 | + ) |
| 135 | + assert( |
| 136 | + statusRowFits(true, MIN_FULLSCREEN_ROWS_FOR_STATUS), |
| 137 | + 'the threshold itself should fit', |
| 138 | + ) |
| 139 | + assert(statusRowFits(true, 80), 'a tall fullscreen terminal should fit') |
| 140 | +}) |
| 141 | + |
| 142 | +test('outside fullscreen a status row always fits', () => { |
| 143 | + // Non-fullscreen has terminal scrollback to absorb overflow, so height |
| 144 | + // never hides a row there - however short the terminal gets. |
| 145 | + for (const rows of [0, 1, 5, 23, 200]) { |
| 146 | + assert( |
| 147 | + statusRowFits(false, rows), |
| 148 | + 'rows=' + rows + ' should still fit outside fullscreen', |
| 149 | + ) |
| 150 | + } |
| 151 | +}) |
| 152 | + |
128 | 153 | test('the two rows never both vanish unless asked', () => { |
129 | 154 | // Guards the regression the gate could introduce: a user who configured a |
130 | 155 | // custom line must never end up with no status row by accident. |
|
0 commit comments