aboutsummaryrefslogtreecommitdiff
path: root/app/tests/test_tui.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/tests/test_tui.py')
-rw-r--r--app/tests/test_tui.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/tests/test_tui.py b/app/tests/test_tui.py
index c121d55..c87374f 100644
--- a/app/tests/test_tui.py
+++ b/app/tests/test_tui.py
@@ -300,6 +300,25 @@ class MenuTableTests(TuiTestCase):
table_title="Backend status", table_rows=self.ROWS)
self.assert_inside_border(screen)
+ def test_notice_line_is_red_and_above_the_table(self):
+ screen = FakeScreen(keys=[10])
+ tui.menu(screen, "Hub", [("Quit", "quit")],
+ table_title="Backend status", table_rows=self.ROWS,
+ notice_lines=[("Warning: ffmpeg not installed!", "err")])
+ x0, _ = self.dialog_box(screen)
+ margin = x0 + 1 + tui.Frame.LIST_MARGIN
+ x, attr = next((x, a) for _, x, text, a in screen.strings
+ if text == "Warning: ffmpeg not installed!")
+ self.assertEqual(x, margin)
+ self.assertEqual(attr, tui._THEME["err"])
+ # The notice sits above the table title ("Backend status").
+ notice_y = next(y for y, _, text, _ in screen.strings
+ if text == "Warning: ffmpeg not installed!")
+ title_y = next(y for y, _, text, _ in screen.strings
+ if text == "Backend status")
+ self.assertLess(notice_y, title_y)
+ self.assert_inside_border(screen)
+
class ConfirmTests(TuiTestCase):
def test_tab_switches_and_enter_activates(self):