fix(cli): make status dividers span terminal width
Some checks failed
Test blackout notifier / test (push) Failing after 2s
Hourly blackout check / check (push) Successful in 3s

This commit is contained in:
2026-07-21 17:01:00 +03:30
parent b317726638
commit 301e57fe70
2 changed files with 53 additions and 16 deletions

View File

@@ -182,6 +182,21 @@ assert_equal "0" "${#SCHEDULE[@]}" \
EMPTY_OUTPUT="$(NO_COLOR=1 COLUMNS=60 render_dashboard "$EMPTY_NOW")"
assert_contains "$EMPTY_OUTPUT" "ALL CLEAR" \
"an empty schedule should render the all-clear screen"
WIDE_EMPTY_OUTPUT="$(NO_COLOR=1 COLUMNS=180 render_dashboard "$EMPTY_NOW")"
WIDE_EMPTY_TOP_LINE="${WIDE_EMPTY_OUTPUT%%$'\n'*}"
WIDE_EMPTY_BOTTOM_LINE="${WIDE_EMPTY_OUTPUT##*$'\n'}"
assert_equal "180" "${#WIDE_EMPTY_TOP_LINE}" \
"the all-clear top divider should span the full terminal width"
assert_equal "180" "${#WIDE_EMPTY_BOTTOM_LINE}" \
"the all-clear bottom divider should span the full terminal width"
WIDE_UNAVAILABLE_OUTPUT="$(NO_COLOR=1 COLUMNS=80 render_unavailable 180)"
WIDE_UNAVAILABLE_TOP_LINE="${WIDE_UNAVAILABLE_OUTPUT%%$'\n'*}"
WIDE_UNAVAILABLE_BOTTOM_LINE="${WIDE_UNAVAILABLE_OUTPUT##*$'\n'}"
assert_equal "180" "${#WIDE_UNAVAILABLE_TOP_LINE}" \
"the unavailable top divider should span the full terminal width"
assert_equal "180" "${#WIDE_UNAVAILABLE_BOTTOM_LINE}" \
"the unavailable bottom divider should use the detected terminal width"
TERMINAL_ACTIVE=1
DRAW_OUTPUT="$(draw_frame $'short\nlonger')"