generated from john/python-template
UI slog continues
This commit is contained in:
@@ -50,6 +50,8 @@ class TestDocumentsPageRendering:
|
||||
assert "Document location" in response.text
|
||||
assert "Archive identifier" in response.text
|
||||
assert "Notes" in response.text
|
||||
assert "Create new item" in response.text
|
||||
assert "Create new person" in response.text
|
||||
assert "Save document" in response.text
|
||||
|
||||
def test_documents_page_lists_seeded_documents(self, app_client):
|
||||
@@ -107,8 +109,8 @@ class TestDocumentsPageRendering:
|
||||
assert "No linked people yet." in response.text
|
||||
assert "0 source(s) linked" in response.text
|
||||
assert "0 job(s) linked" in response.text
|
||||
assert "Add sources" in response.text
|
||||
assert "Create job" in response.text
|
||||
assert "+ Add Source" in response.text
|
||||
assert "+ Add Job" in response.text
|
||||
assert "Sources" in response.text
|
||||
assert "Jobs" in response.text
|
||||
assert "Edit document" in response.text
|
||||
@@ -275,6 +277,8 @@ class TestDocumentsPageRendering:
|
||||
assert "Document location" in response.text
|
||||
assert "Archive identifier" in response.text
|
||||
assert "Notes" in response.text
|
||||
assert "Create new item" in response.text
|
||||
assert "Create new person" in response.text
|
||||
assert "Save changes" in response.text
|
||||
|
||||
def test_document_delete_page_shows_confirmation_when_unlinked(self, app_client):
|
||||
|
||||
@@ -97,6 +97,27 @@ class TestPeoplePageRendering:
|
||||
assert "No linked documents yet." in response.text
|
||||
assert "Link this person from a Document workflow." in response.text
|
||||
|
||||
def test_person_detail_page_resolves_relative_portrait_path_to_uploads_mount(self, app_client):
|
||||
_, client = app_client
|
||||
|
||||
async def _seed_person() -> str:
|
||||
async with session_scope() as session:
|
||||
person = Person(
|
||||
full_name="Portrait Person",
|
||||
portrait_path="portraits/person/seeded.png",
|
||||
)
|
||||
session.add(person)
|
||||
await session.commit()
|
||||
await session.refresh(person)
|
||||
return str(person.id)
|
||||
|
||||
person_id = asyncio.run(_seed_person())
|
||||
response = client.get(f"/ui/people/{person_id}")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Portrait path: portraits/person/seeded.png" in response.text
|
||||
assert "/uploads/portraits/person/seeded.png" in response.text
|
||||
|
||||
def test_person_detail_page_renders_linked_documents(self, app_client):
|
||||
_, client = app_client
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ class TestSourcesPageRendering:
|
||||
assert response.status_code == 200
|
||||
assert "Page 1: page_one.png" in response.text
|
||||
assert "stored_page_one.png" in response.text
|
||||
assert "Open source detail" in response.text
|
||||
|
||||
def test_sources_page_filters_to_document_context(self, app_client):
|
||||
_, client = app_client
|
||||
@@ -93,6 +94,7 @@ class TestSourcesPageRendering:
|
||||
assert "Back to Document" in response.text
|
||||
assert "target_page.png" in response.text
|
||||
assert "other_page.png" not in response.text
|
||||
assert "Open source detail" in response.text
|
||||
|
||||
def test_sources_page_filters_to_job_context(self, app_client, seed_job):
|
||||
_, client = app_client
|
||||
@@ -104,6 +106,7 @@ class TestSourcesPageRendering:
|
||||
assert "Sources for Job" in response.text
|
||||
assert "Back to Job" in response.text
|
||||
assert "job-page.png" in response.text
|
||||
assert "Open source detail" in response.text
|
||||
|
||||
def test_source_detail_page_renders_preview_and_revision_box(self, app_client, seed_job):
|
||||
_, client = app_client
|
||||
@@ -131,6 +134,7 @@ class TestSourcesPageRendering:
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Source detail-source.png" in response.text
|
||||
assert "Back to Sources" in response.text
|
||||
assert "Transcription text" in response.text
|
||||
assert "original transcription text" in response.text
|
||||
assert "Revision text" in response.text
|
||||
|
||||
Reference in New Issue
Block a user