Polish export handoff artifacts
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
|
||||
|
||||
def test_export_center_groups_latest_handoff_artifacts_by_type() -> None:
|
||||
export_center = (ROOT / "frontend" / "src" / "components" / "exports" / "ExportCenter.tsx").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
|
||||
assert "latestHandoffArtifacts" in export_center
|
||||
assert "Latest handoff artifacts" in export_center
|
||||
assert "Project report" in export_center
|
||||
assert "Project metadata" in export_center
|
||||
assert "Dataset GeoJSON" in export_center
|
||||
assert "Detection GeoJSON" in export_center
|
||||
assert "Segmentation GeoJSON" in export_center
|
||||
assert "latest-artifact-grid" in export_center
|
||||
assert "latest-artifact-card" in export_center
|
||||
assert "No artifact yet" in export_center
|
||||
|
||||
|
||||
def test_export_center_latest_artifact_cards_keep_existing_actions() -> None:
|
||||
export_center = (ROOT / "frontend" / "src" / "components" / "exports" / "ExportCenter.tsx").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
|
||||
assert "getLatestExportByType" in export_center
|
||||
assert "const item = artifact.item" in export_center
|
||||
assert "canPreviewJson(item)" in export_center
|
||||
assert "onPreviewContent(item.id)" in export_center
|
||||
assert "onDownload(item.id)" in export_center
|
||||
assert "compactPath(item.storage_path)" in export_center
|
||||
assert "formatExportCreated(item.created_at)" in export_center
|
||||
|
||||
|
||||
def test_export_center_latest_artifact_styles_are_responsive() -> None:
|
||||
css = (ROOT / "frontend" / "src" / "styles" / "app.css").read_text(encoding="utf-8")
|
||||
|
||||
assert ".latest-artifact-grid" in css
|
||||
assert ".latest-artifact-card" in css
|
||||
assert ".latest-artifact-card-empty" in css
|
||||
assert ".latest-artifact-actions" in css
|
||||
assert "grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));" in css
|
||||
Reference in New Issue
Block a user