From 2252a0e4ae86fcc71a58af99d63750adab54cabd Mon Sep 17 00:00:00 2001 From: historia Date: Thu, 27 Aug 2026 15:53:22 -0400 Subject: feat: menu for language options --- app/tests/test_tui.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'app/tests/test_tui.py') diff --git a/app/tests/test_tui.py b/app/tests/test_tui.py index c836178..eb6872a 100644 --- a/app/tests/test_tui.py +++ b/app/tests/test_tui.py @@ -688,6 +688,30 @@ class FormTests(TuiTestCase): self.assertIn("Value: ''", texts) self.assert_inside_border(screen) + def test_choice_menu_shows_the_fields_help_lines(self): + # A choice field's "help" renders as dim lines inside its + # selection menu (like the text editor's hints). + fields = [ + {"key": "fmt", "label": "Format", "kind": "choice", + "value": "mp3", "choices": ["mp3", "ogg"], + "help": ["Check the format docs for supported codecs."]}, + {"key": "chunk", "label": "Chunk", "kind": "text", + "value": "250"}, + ] + # Enter opens the choice menu, Esc backs out; Tab -> Save, Enter. + screen = FakeScreen(keys=[10, 27, 9, 10]) + tui.form(screen, "Settings", fields) + texts = [text for _, _, text, _ in screen.strings] + self.assertIn("Check the format docs for supported codecs.", texts) + self.assert_inside_border(screen) + + # Without the hint nothing renders it. + fields[0].pop("help") + screen = FakeScreen(keys=[10, 27, 9, 10]) + tui.form(screen, "Settings", fields) + texts = [text for _, _, text, _ in screen.strings] + self.assertNotIn("Check the format docs for supported codecs.", texts) + def test_field_note_renders_and_save(self): fields = self._fields() fields[1]["note"] = "A short section note" -- cgit v1.2.3