Remove pauses from DataTable tests

This commit is contained in:
Darren Burns
2023-01-24 13:04:49 +00:00
parent d5c7db41f3
commit 2d498d516d

View File

@@ -58,52 +58,44 @@ async def test_datatable_message_emission():
# therefore no highlighted cells), but then a row was added, and
# so the cell at (0, 0) became highlighted.
expected_messages.append("CellHighlighted")
await pilot.pause(2 / 100)
assert messages == expected_messages
# Pressing Enter when the cursor is on a cell emits a CellSelected
await pilot.press("enter")
expected_messages.append("CellSelected")
await pilot.pause(2 / 100)
assert messages == expected_messages
# Moving the cursor left and up when the cursor is at origin
# emits no events, since the cursor doesn't move at all.
await pilot.press("left", "up")
await pilot.pause(2 / 100)
assert messages == expected_messages
# ROW CURSOR
# Switch over to the row cursor... should emit a `RowHighlighted`
table.cursor_type = "row"
expected_messages.append("RowHighlighted")
await pilot.pause(2 / 100)
assert messages == expected_messages
# Select the row...
await pilot.press("enter")
expected_messages.append("RowSelected")
await pilot.pause(2 / 100)
assert messages == expected_messages
# COLUMN CURSOR
# Switching to the column cursor emits a `ColumnHighlighted`
table.cursor_type = "column"
expected_messages.append("ColumnHighlighted")
await pilot.pause(2 / 100)
assert messages == expected_messages
# Select the column...
await pilot.press("enter")
expected_messages.append("ColumnSelected")
await pilot.pause(2 / 100)
assert messages == expected_messages
# NONE CURSOR
# No messages get emitted at all...
table.cursor_type = "none"
await pilot.press("up", "down", "left", "right", "enter")
await pilot.pause(2 / 100)
# No new messages since cursor not visible
assert messages == expected_messages
@@ -113,7 +105,6 @@ async def test_datatable_message_emission():
table.show_cursor = False
table.cursor_type = "cell"
await pilot.press("up", "down", "left", "right", "enter")
await pilot.pause(2 / 100)
# No new messages since show_cursor = False
assert messages == expected_messages
@@ -121,7 +112,6 @@ async def test_datatable_message_emission():
# message should be emitted for highlighting the cell.
table.show_cursor = True
expected_messages.append("CellHighlighted")
await pilot.pause(2 / 100)
assert messages == expected_messages
# Likewise, if the cursor_type is "none", and we change the
@@ -129,7 +119,6 @@ async def test_datatable_message_emission():
# the cursor is still not visible to the user.
table.cursor_type = "none"
await pilot.press("up", "down", "left", "right", "enter")
await pilot.pause(2 / 100)
assert messages == expected_messages