Skip to content

Commit

Permalink
Add a test for the escape keys
Browse files Browse the repository at this point in the history
  • Loading branch information
davep committed Jan 31, 2024
1 parent 343893d commit a1802d6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/test_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async def test_character_bindings():
counter = 0

class BindApp(App):
BINDINGS = [(".,~,space", "increment", "foo")]
BINDINGS = [(".,~,space,escape", "increment", "foo")]

def action_increment(self) -> None:
nonlocal counter
Expand All @@ -45,9 +45,12 @@ def action_increment(self) -> None:
await pilot.press(" ")
await pilot.pause()
assert counter == 3
await pilot.press("escape") # https://github.com/Textualize/textual/issues/4038
await pilot.pause()
assert counter == 4
await pilot.press("x")
await pilot.pause()
assert counter == 3
assert counter == 4


def test_get_key_display():
Expand Down

0 comments on commit a1802d6

Please sign in to comment.