test: validate closed Following retirement on phone
All checks were successful
CI / lint (pull_request) Successful in 3m25s
CI / build-release (pull_request) Successful in 8s
CI / browser-journey (pull_request) Successful in 5m23s
CI / release-candidate (pull_request) Has been skipped

This commit is contained in:
timmy 2026-08-23 12:26:39 +00:00
parent c4bb7a9be1
commit aa12c4ab9d

View File

@ -19,6 +19,7 @@ def test_following_queue_is_phone_usable_at_narrow_viewport():
page = browser.new_page(viewport={"width": 320, "height": 568}) page = browser.new_page(viewport={"width": 320, "height": 568})
page.set_content((FRONTEND / "index.html").read_text()) page.set_content((FRONTEND / "index.html").read_text())
page.add_style_tag(path=FRONTEND / "dashboard.css") page.add_style_tag(path=FRONTEND / "dashboard.css")
page.add_script_tag(path=FRONTEND / "search-preview.js")
row = page.locator('[data-mobile-queue="following"]') row = page.locator('[data-mobile-queue="following"]')
expect(row).to_have_count(1) expect(row).to_have_count(1)
@ -35,6 +36,22 @@ def test_following_queue_is_phone_usable_at_narrow_viewport():
assert page.locator("#review-following").bounding_box()["height"] >= 44 assert page.locator("#review-following").bounding_box()["height"] >= 44
assert page.locator(".following-card").bounding_box()["height"] >= 44 assert page.locator(".following-card").bounding_box()["height"] >= 44
assert page.locator("#close-following").bounding_box()["height"] >= 44 assert page.locator("#close-following").bounding_box()["height"] >= 44
retire = page.locator("#watch-search-result")
page.evaluate("""() => {
document.querySelector('#following-sheet').close();
document.querySelector('#search-preview').classList.add('open');
const button = document.querySelector('#watch-search-result');
renderSearchPreviewWatch(
{repository:'stackchain/api', number:42, kind:'issue', state:'closed',
following:true, watching:true},
{status:'ready'},
button
);
}""")
expect(retire).to_be_visible()
expect(retire).to_have_text("Stop watching & next")
assert retire.bounding_box()["height"] >= 44
overflow = page.evaluate("document.documentElement.scrollWidth > document.documentElement.clientWidth") overflow = page.evaluate("document.documentElement.scrollWidth > document.documentElement.clientWidth")
assert overflow is False assert overflow is False
browser.close() browser.close()