Improve shift report mode navigation
This commit is contained in:
1 parent
dcde029bc7
commit
211fb45d52
5 files changed
+61
-3
No files matched your search
@@ -15,6 +15,7 @@ from production_analytics.erp.gateway import (
|
||||
OrderConfirmationGroup,
|
||||
OrderConfirmationRow,
|
||||
)
|
||||
from production_analytics.presentation.production_order_html import render_detail, render_search
|
||||
from production_analytics.service.production_order import ProductionOrderService
|
||||
from production_analytics.service.shift_report_config import load_shift_report_machines
|
||||
|
||||
@@ -166,11 +167,22 @@ def test_search_and_detail_web_pages_and_encoded_report_link():
|
||||
assert status == "200 OK" and ORDER in text and "/order?production_order=" in text
|
||||
status, text = web_request(app, "/order", urlencode({"production_order": ORDER}))
|
||||
assert status == "200 OK"
|
||||
assert '<a href="/orders" aria-current="page">Fertigungsauftrag</a>' in text
|
||||
assert "Article name" in text and "10.00 m²" in text
|
||||
assert "Schichtbericht" in text
|
||||
assert "/?date=2026-10-19&shift=early&machine=Gitter+3" in text
|
||||
|
||||
|
||||
@pytest.mark.parametrize("html", [render_search(), render_detail(detail=None)],
|
||||
ids=["search", "detail"])
|
||||
def test_order_pages_mark_order_mode_active(html):
|
||||
assert '<nav class="mode-nav" aria-label="Bereich wählen">' in html
|
||||
assert '<a href="/">Schichtbericht</a>' in html
|
||||
assert '<a href="/orders" aria-current="page">Fertigungsauftrag</a>' in html
|
||||
assert html.split("</style>", 1)[1].count('aria-current="page"') == 1
|
||||
assert ".mode-nav a:focus-visible" in html
|
||||
|
||||
|
||||
def test_order_pages_escape_erp_text():
|
||||
unsafe = "<script>alert(1)</script>"
|
||||
gateway = FakeGateway(
|
||||
|
||||
Reference in new issue
Block a user