Files
intotheeast-com/services/travel-memories/tests/test_phase3.py
T
2026-06-21 16:33:58 +02:00

41 lines
1.5 KiB
Python

import json
def test_only_kept_photos_shown(base_url, page, seed_state):
album_id = seed_state("phase3_state")
page.goto(f"{base_url}/curate?album_id={album_id}")
# phase3_state has 2 kept (journal+story) and 1 skipped
assert page.locator(".photo-card").count() == 2
def test_remove_reverts_to_skip(base_url, page, seed_state, flask_app):
album_id = seed_state("phase3_state")
page.goto(f"{base_url}/curate?album_id={album_id}")
page.locator(".remove-btn").first.click()
page.wait_for_timeout(300)
assert page.locator(".photo-card").count() == 1
with flask_app.app_context():
from app.state import load_state
state = load_state(album_id, flask_app)
removed = next(p for p in state.photos if p.id == "asset-1")
assert removed.tag == "skip"
def test_retag_journal_to_story(base_url, page, seed_state, flask_app):
album_id = seed_state("phase3_state")
page.goto(f"{base_url}/curate?album_id={album_id}")
page.locator(".retag-btn").first.click()
page.wait_for_timeout(300)
with flask_app.app_context():
from app.state import load_state
state = load_state(album_id, flask_app)
p = next(p for p in state.photos if p.id == "asset-1")
assert p.tag == "story"
def test_done_advances_to_group(base_url, page, seed_state):
album_id = seed_state("phase3_state")
page.goto(f"{base_url}/curate?album_id={album_id}")
page.locator("#done-btn").click()
page.wait_for_url("**/group**")