feat: keep Human Gate decisions in reach on mobile (Closes #1439)
This commit is contained in:
1 parent
38206b90e4
commit
62f92105ec
19 files changed
+209
-56
No files matched your search
@@ -29,6 +29,7 @@ def test_release_artifact_reopens_human_gates_with_one_fresh_mobile_snapshot(
|
||||
current = {"gate": "g1"}
|
||||
evidence_url = {"value": "/evidence/manifest"}
|
||||
list_requests: list[str] = []
|
||||
decision_requests: list[str] = []
|
||||
browser_errors: list[str] = []
|
||||
|
||||
def gate(gate_id: str) -> dict:
|
||||
@@ -61,6 +62,7 @@ def test_release_artifact_reopens_human_gates_with_one_fresh_mobile_snapshot(
|
||||
def human_gates_route(route):
|
||||
path = route.request.url.split("?", 1)[0]
|
||||
if route.request.method == "POST":
|
||||
decision_requests.append(path)
|
||||
payload = {"receipt_id": "receipt-1", "state": "released"}
|
||||
elif path.endswith("/api/v1/human-gates"):
|
||||
list_requests.append(current["gate"])
|
||||
@@ -81,9 +83,31 @@ def test_release_artifact_reopens_human_gates_with_one_fresh_mobile_snapshot(
|
||||
expect(page.locator("#human-gates")).to_be_visible()
|
||||
expect(page.locator("#human-gate-detail")).to_contain_text("First candidate")
|
||||
|
||||
tray = page.locator(".human-gate-decision-tray")
|
||||
expect(tray).to_be_visible()
|
||||
expect(page.locator("[data-gate-readiness]")).to_have_text(
|
||||
"0 of 3 confirmations complete"
|
||||
)
|
||||
tray_bounds = tray.bounding_box()
|
||||
assert tray_bounds
|
||||
assert tray_bounds["y"] + tray_bounds["height"] <= height + 1
|
||||
for action in ("hold", "release"):
|
||||
bounds = page.locator(f'[data-gate-decision="{action}"]').bounding_box()
|
||||
assert bounds and bounds["height"] >= 44
|
||||
|
||||
page.locator('[data-gate-decision="release"]').click()
|
||||
expect(page.locator("[data-gate-error]")).to_contain_text(
|
||||
"Complete the release checklist"
|
||||
)
|
||||
expect(page.locator('[data-gate-checklist="exact_hash"]')).to_be_focused()
|
||||
assert decision_requests == []
|
||||
|
||||
page.locator('[data-gate-checklist="exact_hash"]').check()
|
||||
page.locator('[data-gate-checklist="artifacts_reviewed"]').check()
|
||||
page.locator('[data-gate-checklist="provenance_reviewed"]').check()
|
||||
expect(page.locator("[data-gate-readiness]")).to_have_text(
|
||||
"3 of 3 confirmations complete"
|
||||
)
|
||||
page.locator("[data-gate-reason]").fill("Awaiting final approval")
|
||||
with page.expect_popup() as popup_info:
|
||||
page.get_by_role("link", name="Signed manifest").click()
|
||||
@@ -108,6 +132,8 @@ def test_release_artifact_reopens_human_gates_with_one_fresh_mobile_snapshot(
|
||||
assert page.evaluate("key => localStorage.getItem(key) !== null", progress_key)
|
||||
page.locator('[data-gate-decision="release"]').click()
|
||||
expect(page.locator("#human-gates-status")).to_contain_text("Decision saved")
|
||||
expect(page.locator(".human-gate-decision-tray")).to_have_count(0)
|
||||
assert len(decision_requests) == 1
|
||||
assert not page.evaluate("key => localStorage.getItem(key) !== null", progress_key)
|
||||
|
||||
page.evaluate("document.querySelector('#close-human-gates').click()")
|
||||
|
||||
Reference in new issue
Block a user