Selecting from outside (above) to outside (below) of a scrollable container should select all of its content.
()
| 124 | |
| 125 | |
| 126 | async def test_select_across_scrollable_container(): |
| 127 | """Selecting from outside (above) to outside (below) of a scrollable |
| 128 | container should select all of its content.""" |
| 129 | |
| 130 | app = _ScrollableSelectApp() |
| 131 | async with app.run_test(size=(20, 10)) as pilot: |
| 132 | await pilot.pause() |
| 133 | scroller = app.query_one("#scroller", VerticalScroll) |
| 134 | scroller.scroll_to(y=2, animate=False) |
| 135 | await pilot.pause() |
| 136 | |
| 137 | # Selection: BEFORE (y=0) to AFTER (y=7). |
| 138 | assert await pilot.mouse_down(offset=(0, 0)) |
| 139 | await pilot.pause() |
| 140 | assert await pilot.mouse_up(offset=(0, 7)) |
| 141 | selected_text = app.screen.get_selected_text() or "" |
| 142 | |
| 143 | assert "BEFORE" in selected_text |
| 144 | assert "AFTER" in selected_text |
| 145 | for i in range(0, 10): |
| 146 | assert ( |
| 147 | f"item-{i:02d}" in selected_text |
| 148 | ), f"item-{i:02d} missing from {selected_text!r}" |
| 149 | |
| 150 | |
| 151 | class _GappedScrollApp(App): |
nothing calls this directly
no test coverage detected
searching dependent graphs…