feat(ui): keep the current view in the url hash
This commit is contained in:
1 parent
5f4b3cb564
commit
adc708ae29
4 files changed
+66
-10
No files matched your search
@@ -159,3 +159,27 @@ def test_the_header_shows_the_running_version(page):
|
||||
stamp = page.locator("#app-version").text_content()
|
||||
assert stamp.startswith("v")
|
||||
assert len(stamp) > 3 # version plus the build stamp behind it
|
||||
|
||||
|
||||
def test_the_view_survives_reload_and_back(page, server):
|
||||
page.click("nav button[data-view=missing]")
|
||||
assert page.url.endswith("#missing")
|
||||
page.reload(wait_until="networkidle")
|
||||
assert page.locator("#view-missing").is_visible()
|
||||
assert not page.locator("#view-search").is_visible()
|
||||
page.click("nav button[data-view=settings]")
|
||||
page.go_back()
|
||||
assert page.locator("#view-missing").is_visible()
|
||||
assert page.locator("nav button[data-view=missing]").get_attribute("class") == "active"
|
||||
|
||||
|
||||
def test_a_card_opens_from_the_keyboard(page, server, tmp_path):
|
||||
lib = page.request.post(f"{server}/api/libraries", data={
|
||||
"name": "Tastatur", "media_type": "ebook", "root_path": str(tmp_path)}).json()
|
||||
page.request.post(f"{server}/api/requests", data={
|
||||
"title": "Zyxw Tastaturprobe", "library_id": lib["id"]})
|
||||
page.click("nav button[data-view=missing]")
|
||||
card = page.locator("[data-detail]", has_text="Zyxw Tastaturprobe")
|
||||
card.focus()
|
||||
page.keyboard.press("Enter")
|
||||
assert page.locator("#detail-dialog").is_visible()
|
||||
Reference in new issue
Block a user