Selecting from outside (above) into a scrollable container should pick up items scrolled above the visible area.
()
| 72 | |
| 73 | |
| 74 | async def test_select_into_scrollable_container(): |
| 75 | """Selecting from outside (above) into a scrollable container should pick up |
| 76 | items scrolled above the visible area.""" |
| 77 | |
| 78 | app = _ScrollableSelectApp() |
| 79 | async with app.run_test(size=(20, 10)) as pilot: |
| 80 | await pilot.pause() |
| 81 | scroller = app.query_one("#scroller", VerticalScroll) |
| 82 | # Scroll so items 00-02 are scrolled above the visible area. |
| 83 | scroller.scroll_to(y=3, animate=False) |
| 84 | await pilot.pause() |
| 85 | |
| 86 | # Selection: start on "BEFORE" (y=0), end inside the container on the |
| 87 | # last visible row. |
| 88 | assert await pilot.mouse_down(offset=(0, 0)) |
| 89 | await pilot.pause() |
| 90 | assert await pilot.mouse_up(offset=(7, 5)) |
| 91 | selected_text = app.screen.get_selected_text() or "" |
| 92 | |
| 93 | assert "BEFORE" in selected_text |
| 94 | for i in range(0, 7): |
| 95 | assert ( |
| 96 | f"item-{i:02d}" in selected_text |
| 97 | ), f"item-{i:02d} missing from {selected_text!r}" |
| 98 | assert "AFTER" not in selected_text |
| 99 | |
| 100 | |
| 101 | async def test_select_out_of_scrollable_container(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…