test: recover queue during active Today journey
Some checks failed
CI / lint (pull_request) Successful in 2m30s
CI / build-release (pull_request) Successful in 5s
CI / browser-journey (pull_request) Failing after 2m23s
CI / release-candidate (pull_request) Has been skipped

This commit is contained in:
timmy 2026-08-17 21:46:18 +00:00
parent f7b2a96206
commit ce2f04ab6d

View File

@ -98,8 +98,18 @@ def test_release_artifact_plans_hands_off_and_opens_next_mobile_issue(tmp_path:
page.locator('[data-today-break-minutes="5"]').click()
expect(page.locator("#today-break-status")).to_have_text("On break · resume in 5:00")
expect(page.locator("[data-mobile-today-toggle]")).to_have_text("Resume timer")
page.evaluate("""() => {
const prefix = 'stackchain.today-sync.v1.timmy.operation.';
localStorage.setItem(prefix + 'broken', '{not-json');
}""")
page.reload(wait_until="networkidle")
expect(page.locator("#my-work-status")).to_contain_text("2")
expect(page.locator("#today-sync-status")).to_have_text(
"Recovered 1 Today edit · discarded 1 unreadable device record."
)
assert page.evaluate("""() => !Object.keys(localStorage).some(
key => key.startsWith('stackchain.today-sync.v1.timmy.operation.')
)""")
expect(page.locator("#today-break-status")).to_contain_text("On break · resume in")
if page.locator("#issue-sheet").get_attribute("class") == "issue-sheet open":
page.locator("#close-issue-sheet").click()
@ -160,17 +170,6 @@ def test_release_artifact_plans_hands_off_and_opens_next_mobile_issue(tmp_path:
today = page.evaluate("JSON.parse(localStorage.getItem('stackchain.today-work.v1.timmy') || '[]')")
assert today == ["issue:acme/mobile:41:", "issue:acme/mobile:42:"]
page.evaluate("""() => {
const prefix = 'stackchain.today-sync.v1.timmy.operation.';
localStorage.setItem(prefix + 'broken', '{not-json');
}""")
page.reload(wait_until="networkidle")
expect(page.locator("#today-sync-status")).to_have_text(
"Recovered 1 Today edit · discarded 1 unreadable device record."
)
assert page.evaluate("""() => !Object.keys(localStorage).some(
key => key.startsWith('stackchain.today-sync.v1.timmy.operation.')
)""")
assert page.evaluate("document.documentElement.scrollWidth <= window.innerWidth")
assert browser_errors == []
assert failed_responses == []