From 19f4f64d96585ffe555dcab4c30b7b88e4845572 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Thu, 4 May 2023 15:39:33 +0100 Subject: [PATCH] Add tests for selection navigation in a radioset with no buttons pressed --- tests/toggles/test_radioset.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/toggles/test_radioset.py b/tests/toggles/test_radioset.py index 66cfb80e7..b2869eb5a 100644 --- a/tests/toggles/test_radioset.py +++ b/tests/toggles/test_radioset.py @@ -79,6 +79,15 @@ async def test_radioset_inner_navigation(): pilot.app.query_one("#from_buttons", RadioSet).pressed_button == pilot.app.query_one("#from_buttons").children[landing] ) + async with RadioSetApp().run_test() as pilot: + assert pilot.app.screen.focused is None + await pilot.press("tab") + assert pilot.app.screen.focused is pilot.app.screen.query_one("#from_buttons") + await pilot.press("tab") + assert pilot.app.screen.focused is pilot.app.screen.query_one("#from_strings") + assert pilot.app.query_one("#from_strings", RadioSet)._selected == 0 + await pilot.press("down") + assert pilot.app.query_one("#from_strings", RadioSet)._selected == 1 async def test_radioset_breakout_navigation():