mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Test messages when toggling a selection via user input
This commit is contained in:
@@ -71,6 +71,19 @@ async def test_toggle() -> None:
|
||||
]
|
||||
|
||||
|
||||
async def test_toggle_via_user() -> None:
|
||||
"""Toggling via the user should result in the correct messages."""
|
||||
async with SelectionListApp().run_test() as pilot:
|
||||
assert isinstance(pilot.app, SelectionListApp)
|
||||
await pilot.press("space")
|
||||
await pilot.pause()
|
||||
assert pilot.app.messages == [
|
||||
("SelectionHighlighted", 0),
|
||||
("SelectedChanged", None),
|
||||
("SelectionToggled", 0),
|
||||
]
|
||||
|
||||
|
||||
async def test_toggle_all() -> None:
|
||||
"""Toggling all options should result in messages."""
|
||||
async with SelectionListApp().run_test() as pilot:
|
||||
|
||||
Reference in New Issue
Block a user