Reuse stops when zooming within loaded map bounds
This commit is contained in:
parent
e8d0ff5c2c
commit
8ed7b8d112
2 changed files with 17 additions and 23 deletions
|
|
@ -122,7 +122,7 @@ def test_search_and_stop_details_in_browser(chromium_browser: Any, flask_url: st
|
|||
|
||||
|
||||
def test_moving_map_loads_only_when_zoomed_in(chromium_browser: Any, flask_url: str) -> None:
|
||||
"""Panning a close map loads visible stops while a wide map makes no query."""
|
||||
"""Map loads skip wide views and zoom-ins already covered by fetched bounds."""
|
||||
page = chromium_browser.new_page(viewport={"width": 1280, "height": 800})
|
||||
requests: list[str] = []
|
||||
|
||||
|
|
@ -154,13 +154,13 @@ def test_moving_map_loads_only_when_zoomed_in(chromium_browser: Any, flask_url:
|
|||
playwright_api.expect(page.locator("#stop-name")).to_have_text("Temple Meads")
|
||||
page.wait_for_timeout(700)
|
||||
playwright_api.expect(page.locator("#stop-detail")).to_be_visible()
|
||||
assert len(requests) == 3
|
||||
page.evaluate("userMapInteractionPending = true; map.panBy([80, 0])")
|
||||
assert len(requests) == 2
|
||||
page.evaluate("userMapInteractionPending = true; map.panBy([2500, 0])")
|
||||
page.wait_for_timeout(700)
|
||||
playwright_api.expect(page.locator("#stop-name")).to_have_text("Temple Meads")
|
||||
playwright_api.expect(page.locator("#stop-detail")).to_be_visible()
|
||||
playwright_api.expect(page).to_have_url(re.compile(r"\?node=456$"))
|
||||
assert len(requests) == 4
|
||||
assert len(requests) == 3
|
||||
page.close()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue