Skip to content

Commit 546df40

Browse files
committed
test(dashboard): allow scroll clamping after refresh
1 parent 2cb1b08 commit 546df40

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

e2e/features/dashboard/test_dashboard_metrics_visual.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,10 @@ def test_dashboard_live_refresh_preserves_interaction_state(seeded_learning_stat
209209
page.wait_for_timeout(2000)
210210

211211
assert assessment_id in detail.inner_text()
212-
assert page.evaluate("window.scrollY") == old_scroll
212+
max_scroll = page.evaluate(
213+
"Math.max(0, document.documentElement.scrollHeight - window.innerHeight)"
214+
)
215+
assert page.evaluate("window.scrollY") == min(old_scroll, max_scroll)
213216
finally:
214217
browser.close()
215218

0 commit comments

Comments
 (0)