test: validate closed Following retirement on phone
This commit is contained in:
parent
c4bb7a9be1
commit
aa12c4ab9d
|
|
@ -19,6 +19,7 @@ def test_following_queue_is_phone_usable_at_narrow_viewport():
|
|||
page = browser.new_page(viewport={"width": 320, "height": 568})
|
||||
page.set_content((FRONTEND / "index.html").read_text())
|
||||
page.add_style_tag(path=FRONTEND / "dashboard.css")
|
||||
page.add_script_tag(path=FRONTEND / "search-preview.js")
|
||||
|
||||
row = page.locator('[data-mobile-queue="following"]')
|
||||
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(".following-card").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")
|
||||
assert overflow is False
|
||||
browser.close()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user