Add CSS class tests for check boxes and radio buttons

This commit is contained in:
Dave Pearson
2023-02-23 21:10:21 +00:00
parent 7c6522e634
commit 236266248d
2 changed files with 20 additions and 0 deletions

View File

@@ -26,6 +26,11 @@ async def test_radio_button_initial_state() -> None:
False,
True,
]
assert [button.has_class("-on") for button in pilot.app.query(RadioButton)] == [
False,
False,
True,
]
assert pilot.app.events_received == []
@@ -39,6 +44,11 @@ async def test_radio_button_toggle() -> None:
True,
False,
]
assert [button.has_class("-on") for button in pilot.app.query(RadioButton)] == [
True,
True,
False,
]
await pilot.pause()
assert pilot.app.events_received == [
("rb1", True),