diff options
| author | historia <historiavg@proton.me> | 2026-08-26 18:18:21 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-08-26 18:18:21 -0400 |
| commit | 544486a374cd5cae7acce1302648d8dad079db48 (patch) | |
| tree | 5987cdb6790844252ec655465eacea8ae526e3a8 /app/tests/test_tui.py | |
| parent | 6ccb6d443d2fb871b43d96ea61a95bc3e6a92355 (diff) | |
| download | tts-audiobook-generator-544486a374cd5cae7acce1302648d8dad079db48.tar.gz | |
fix: default directory when choosing voices in tui
Diffstat (limited to 'app/tests/test_tui.py')
| -rw-r--r-- | app/tests/test_tui.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/tests/test_tui.py b/app/tests/test_tui.py index b15419b..b839a71 100644 --- a/app/tests/test_tui.py +++ b/app/tests/test_tui.py @@ -981,6 +981,26 @@ class CheckboxTreeTests(TuiTestCase): checked={(0, "pkg-b"), (1, "pkg-c")}) self.assertEqual(picked, [(0, "pkg-b"), (1, "pkg-c")]) + def test_start_on_buttons_confirms_immediately(self): + # start_on_buttons=True (the seeded modify flow): Enter alone + # accepts the pre-checked tree with no Tab first. + screen = FakeScreen(keys=[10]) + picked = tui.checkbox_tree( + screen, "Pick models", self.FAMILIES, + checked={(0, "pkg-b"), (1, "pkg-c")}, start_on_buttons=True) + self.assertEqual(picked, [(0, "pkg-b"), (1, "pkg-c")]) + + def test_start_on_buttons_without_selection_flashes(self): + # Focus starting on Confirm changes nothing else: Enter with an + # empty tree flashes and stays (the flash dismiss consumes one + # scripted key); the user then moves back to the rows, checks + # one, and confirms for real. + keys = [10, 9, 9, 10, 9, 10] + screen = FakeScreen(keys=keys) + picked = tui.checkbox_tree(screen, "Pick models", self.FAMILIES, + start_on_buttons=True) + self.assertEqual(picked, [(0, "pkg-a")]) + def test_prechecked_options_draw_as_checked(self): screen = FakeScreen(keys=[9, 10]) tui.checkbox_tree(screen, "Pick models", self.FAMILIES, |
