mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
DataTable - fix crash when selection made in empty table (#1973)
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
from rich.style import Style
|
||||
from rich.text import Text
|
||||
|
||||
from textual._wait import wait_for_idle
|
||||
from textual.actions import SkipAction
|
||||
from textual.app import App
|
||||
from textual.coordinate import Coordinate
|
||||
from textual.events import Click, MouseMove
|
||||
from textual.geometry import Offset
|
||||
from textual.message import Message
|
||||
from textual.widgets import DataTable
|
||||
@@ -166,6 +164,13 @@ async def test_datatable_message_emission():
|
||||
assert app.message_names == expected_messages
|
||||
|
||||
|
||||
async def test_empty_table_interactions():
|
||||
app = DataTableApp()
|
||||
async with app.run_test() as pilot:
|
||||
await pilot.press("enter", "up", "down", "left", "right")
|
||||
assert app.message_names == []
|
||||
|
||||
|
||||
async def test_add_rows():
|
||||
app = DataTableApp()
|
||||
async with app.run_test():
|
||||
|
||||
Reference in New Issue
Block a user