diff options
| author | historia <historiavg@proton.me> | 2026-08-27 15:53:22 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-08-27 15:53:22 -0400 |
| commit | 2252a0e4ae86fcc71a58af99d63750adab54cabd (patch) | |
| tree | 489a5e5d2124a831be31a69ee740ec4c260661e1 /app/tests/test_tui.py | |
| parent | 5b98993b13dafe9a85495e4c68ad9b42863ef2bf (diff) | |
| download | tts-audiobook-generator-2252a0e4ae86fcc71a58af99d63750adab54cabd.tar.gz | |
feat: menu for language options
Diffstat (limited to 'app/tests/test_tui.py')
| -rw-r--r-- | app/tests/test_tui.py | 24 |
1 files changed, 24 insertions, 0 deletions
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" |
