39d19cf2f8
Implements GET / listing Immich albums with resume badge, POST /select creating TripState and redirecting to /triage; graceful error display when Immich is unreachable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
def test_album_list_renders(base_url, page):
|
|
page.goto(base_url)
|
|
assert page.locator(".album-card").count() == 1
|
|
assert "Central Asia 2023" in page.inner_text(".album-card")
|
|
|
|
|
|
def test_select_single_album_creates_state(base_url, page):
|
|
page.goto(base_url)
|
|
page.locator(".album-card input[type=checkbox]").first.check()
|
|
page.fill("#grav-slug", "central-asia-2023")
|
|
page.locator("button[type=submit]").click()
|
|
page.wait_for_url("**/triage**")
|
|
assert "album_id=album-1" in page.url
|
|
|
|
|
|
def test_resume_prompt_shown_for_existing_state(base_url, page, seed_state):
|
|
seed_state("phase2_state")
|
|
page.goto(base_url)
|
|
assert page.locator("[data-album-id=album-1] .resume-badge").is_visible()
|
|
|
|
|
|
def test_immich_unreachable_shows_error(base_url, page, monkeypatch):
|
|
import app.routes.albums as a
|
|
orig = a.ImmichClient
|
|
class BrokenClient:
|
|
def __init__(self, *a, **k): pass
|
|
def list_albums(self): raise ConnectionError("down")
|
|
monkeypatch.setattr(a, "ImmichClient", BrokenClient)
|
|
page.goto(base_url)
|
|
assert page.locator(".alert-error").is_visible()
|