mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Add a test that toggling a pressed radio button has no effect
This commit is contained in:
@@ -52,6 +52,15 @@ async def test_radio_sets_toggle():
|
||||
]
|
||||
|
||||
|
||||
async def test_radioset_same_button_mash():
|
||||
"""Mashing the same button should have no effect."""
|
||||
async with RadioSetApp().run_test() as pilot:
|
||||
assert pilot.app.query_one("#from_buttons", RadioSet).pressed_index == 2
|
||||
pilot.app.query_one("#from_buttons", RadioSet)._nodes[2].toggle()
|
||||
assert pilot.app.query_one("#from_buttons", RadioSet).pressed_index == 2
|
||||
assert pilot.app.events_received == []
|
||||
|
||||
|
||||
async def test_radioset_inner_navigation():
|
||||
"""Using the cursor keys should navigate between buttons in a set."""
|
||||
async with RadioSetApp().run_test() as pilot:
|
||||
|
||||
Reference in New Issue
Block a user