generated from john/python-template
UI style refresh continued
This commit is contained in:
@@ -30,8 +30,7 @@ class TestDocumentsPageRendering:
|
||||
assert response.status_code == 200
|
||||
assert "Documents" in response.text
|
||||
assert "Create new document" in response.text
|
||||
assert "No documents yet." in response.text
|
||||
assert "Create your first document" in response.text
|
||||
assert "No documents in repository yet." in response.text
|
||||
|
||||
def test_document_create_page_renders_fields(self, app_client):
|
||||
"""GET /ui/documents/new renders document-create form fields."""
|
||||
@@ -40,7 +39,7 @@ class TestDocumentsPageRendering:
|
||||
response = client.get("/ui/documents/new")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Create document" in response.text
|
||||
assert "Create Document" in response.text
|
||||
assert "Document name is required." in response.text
|
||||
assert "Document name" in response.text
|
||||
assert "Document type" in response.text
|
||||
@@ -69,7 +68,7 @@ class TestDocumentsPageRendering:
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Seeded Document" in response.text
|
||||
assert "Type: letter" in response.text
|
||||
assert "letter" in response.text
|
||||
|
||||
def test_document_detail_page_renders_metadata_and_empty_related_sections(self, app_client):
|
||||
"""GET /ui/documents/{document_id} shows metadata and related empty states."""
|
||||
@@ -97,24 +96,30 @@ class TestDocumentsPageRendering:
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Zenna Letter" in response.text
|
||||
assert "Document type: letter" in response.text
|
||||
assert "Author: not set" in response.text
|
||||
assert "Exact date: 1885-07-13" in response.text
|
||||
assert "Approximate date: c. 1885" in response.text
|
||||
assert "Location created: Ohio" in response.text
|
||||
assert "Archive identifier: BOX-1-FOLDER-2" in response.text
|
||||
assert "Notes: Family archive" in response.text
|
||||
assert "Created at (read-only):" in response.text
|
||||
assert "Updated at (read-only):" in response.text
|
||||
assert "Type: letter" in response.text
|
||||
assert "Author:" in response.text
|
||||
assert "Not set" in response.text
|
||||
assert "Exact Date:" in response.text
|
||||
assert "1885-07-13" in response.text
|
||||
assert "Approx. Date:" in response.text
|
||||
assert "c. 1885" in response.text
|
||||
assert "Location Created:" in response.text
|
||||
assert "Ohio" in response.text
|
||||
assert "Archive Identifier:" in response.text
|
||||
assert "BOX-1-FOLDER-2" in response.text
|
||||
assert "Archival Notes:" in response.text
|
||||
assert "Family archive" in response.text
|
||||
assert "Created:" in response.text
|
||||
assert "Updated:" in response.text
|
||||
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 "0 Source(s) Linked" in response.text
|
||||
assert "0 Active Jobs" 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
|
||||
assert "Delete document" in response.text
|
||||
assert "Edit Document" in response.text
|
||||
assert "Delete" in response.text
|
||||
|
||||
def test_document_detail_page_renders_related_people_sources_and_jobs(self, app_client):
|
||||
"""GET /ui/documents/{document_id} shows related records when present."""
|
||||
@@ -158,10 +163,11 @@ class TestDocumentsPageRendering:
|
||||
response = client.get(f"/ui/documents/{document_id}")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Jane Doe (author)" in response.text
|
||||
assert "Author: Jane Doe" in response.text
|
||||
assert "1 source(s) linked" in response.text
|
||||
assert "1 job(s) linked" in response.text
|
||||
assert "Jane Doe" in response.text
|
||||
assert "author" in response.text
|
||||
assert "Author:" in response.text
|
||||
assert "1 Source(s) Linked" in response.text
|
||||
assert "1 Active Jobs" in response.text
|
||||
|
||||
def test_document_jobs_page_filters_to_document_context(self, app_client):
|
||||
_, client = app_client
|
||||
@@ -223,7 +229,7 @@ class TestDocumentsPageRendering:
|
||||
response = client.get(f"/ui/sources?document_id={document_id}")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Sources for Target" in response.text
|
||||
assert "Sources: Target" in response.text
|
||||
assert "Back to Document" in response.text
|
||||
assert "target_page.png" in response.text
|
||||
assert "other_page.png" not in response.text
|
||||
@@ -267,7 +273,7 @@ class TestDocumentsPageRendering:
|
||||
response = client.get(f"/ui/documents/{document_id}/edit")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Edit document" in response.text
|
||||
assert "Edit Document Record" in response.text
|
||||
assert "Document name and document type are required." in response.text
|
||||
assert "Document name" in response.text
|
||||
assert "Document type" in response.text
|
||||
@@ -298,7 +304,7 @@ class TestDocumentsPageRendering:
|
||||
response = client.get(f"/ui/documents/{document_id}/delete")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Delete document" in response.text
|
||||
assert "Delete Document" in response.text
|
||||
assert "This action permanently deletes the document." in response.text
|
||||
assert "Delete document permanently" in response.text
|
||||
|
||||
|
||||
Reference in New Issue
Block a user