generated from john/python-template
This commit is contained in:
@@ -153,6 +153,36 @@ class TestDocumentsPageRendering:
|
||||
assert "1924-07-04" not in response.text
|
||||
assert "PIPELINE JOBS" in response.text.upper()
|
||||
assert "Edit Document" in response.text
|
||||
assert "Back to Documents" in response.text
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_document_detail_page_renders_person_context_back_button(self, app_client, seed_person_and_document):
|
||||
_, client = app_client
|
||||
doc_id, person_id = seed_person_and_document
|
||||
|
||||
response = client.get(f"/ui/documents/{doc_id}?from=person&person_id={person_id}")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Back to Person" in response.text
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_document_detail_page_renders_job_context_back_button(self, app_client):
|
||||
_, client = app_client
|
||||
|
||||
async with session_scope() as session:
|
||||
doc = Document(name="Job-linked Document")
|
||||
session.add(doc)
|
||||
await session.flush()
|
||||
job = Job(document_id=doc.id)
|
||||
session.add(job)
|
||||
await session.commit()
|
||||
doc_id = str(doc.id)
|
||||
job_id = str(job.id)
|
||||
|
||||
response = client.get(f"/ui/documents/{doc_id}?from=job&job_id={job_id}")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Back to Job" in response.text
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_document_jobs_page_redirects_to_filtered_jobs(self, app_client):
|
||||
|
||||
@@ -85,6 +85,7 @@ class TestJobsPageRendering:
|
||||
assert "Jobs for Document" in response.text
|
||||
assert "Create job" not in response.text
|
||||
assert "Refresh" not in response.text
|
||||
assert "Back to Document" in response.text
|
||||
assert first_job_id in response.text
|
||||
assert second_job_id not in response.text
|
||||
|
||||
@@ -131,10 +132,25 @@ class TestJobsPageRendering:
|
||||
assert "Document Name:" in response.text
|
||||
assert "Sources:" in response.text
|
||||
assert "View Sources" in response.text
|
||||
assert "Back to Jobs" in response.text
|
||||
assert "View Linked Document" not in response.text
|
||||
assert "View Linked Sources" not in response.text
|
||||
assert "updates automatically while the job is active" in response.text
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_job_detail_page_renders_document_context_back_button(
|
||||
self,
|
||||
app_client,
|
||||
seed_document_with_unlinked_job,
|
||||
):
|
||||
_, client = app_client
|
||||
document_id, job_id = seed_document_with_unlinked_job
|
||||
|
||||
response = client.get(f"/ui/jobs/{job_id}?from=document&document_id={document_id}")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Back to Document" in response.text
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_job_cancel_page_renders_confirmation(self, app_client, seed_document_with_unlinked_job):
|
||||
_, client = app_client
|
||||
|
||||
@@ -134,9 +134,27 @@ class TestPeoplePageRendering:
|
||||
assert "Open in FamilySearch" not in response.text
|
||||
assert "FamilySearch ID:" in response.text
|
||||
assert "familysearch.org/tree/person/details/G8T4-MDQ" in response.text
|
||||
assert "Back to People" in response.text
|
||||
assert "New Document" in response.text
|
||||
assert "No linked documents yet." in response.text
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_person_detail_page_renders_document_context_back_button(self, app_client):
|
||||
_, client = app_client
|
||||
|
||||
async with session_scope() as session:
|
||||
person = Person(given_names="Context", last_name="Person")
|
||||
document = Document(name="Context Document")
|
||||
session.add_all([person, document])
|
||||
await session.commit()
|
||||
person_id = str(person.id)
|
||||
document_id = str(document.id)
|
||||
|
||||
response = client.get(f"/ui/people/{person_id}?from=document&document_id={document_id}")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Back to Document" in response.text
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_person_detail_page_resolves_relative_photo_path(self, app_client):
|
||||
app, client = app_client
|
||||
|
||||
Reference in New Issue
Block a user