feat: retire completed Week Ahead work (Closes #1235)

This commit is contained in:
timmy committed 2026-08-21 20:12:48 +00:00
1 parent a8c1329676
commit 1be9da3685
19 files changed
+167 -36

No files matched your search

+19 -3
View File
@@ -53,6 +53,14 @@ def test_release_artifact_plans_seven_touch_safe_mobile_dates(
}))
page.route("**/api/v1/week", week_route)
page.route(
"**/api/v1/repos/acme/mobile/issues/41/close",
lambda route: route.fulfill(
status=200,
content_type="application/json",
body='{"number":41,"state":"closed","updated_at":"2026-08-21T12:00:00Z"}',
),
)
page.goto(origin + "/", wait_until="networkidle")
page.locator('input[name="device_label"]').fill("Week Ahead release phone")
page.locator('input[name="access_token"]').fill(ACCESS_TOKEN)
@@ -108,11 +116,19 @@ def test_release_artifact_plans_seven_touch_safe_mobile_dates(
expect(page.locator("#issue-sheet")).to_have_class(re.compile(r"\bopen\b"))
expect(page.locator("#issue-sheet-title")).to_have_text("Ship mobile capture")
expect(overview).to_be_visible()
page.locator("#close-issue-sheet").click()
page.once("dialog", lambda dialog: dialog.accept())
page.locator("#close-issue").click()
expect(page.locator("#issue-sheet")).not_to_have_class(re.compile(r"\bopen\b"))
expect(overview).to_be_visible()
expect(planned_item).to_be_focused()
assert len(saved) == 1, "opening and inspecting Week Ahead must not add a write"
expect(cards.first).not_to_contain_text("Ship mobile capture")
expect(cards.first).to_contain_text("0 items · 0 of 60 min")
expect(page.locator("#week-review-status")).to_have_text(
"Ship mobile capture removed and Week Ahead saved."
)
expect(edit_week).to_be_focused()
assert len(saved) == 2, "closing planned work must stage one Week Ahead retirement"
assert saved[-1]["days"][0]["ids"] == []
assert saved[-1]["days"][0]["capacity_minutes"] == 60
for control in (cards.first.locator("[data-week-edit-day]"), edit_week):
bounds = control.bounding_box()
assert bounds and bounds["height"] >= 44