test(HEL-845): wait for settled before and after colors

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
2026-10-25 02:13:53 +08:00
co-authored by multica-agent
parent c1d4feb4a8
commit bc2a70ac5f
+10
View File
@@ -171,12 +171,22 @@ try:
old = page.add_style_tag(
content='[data-theme="day"] .lib2 {--lib-option-bg:var(--hi);--lib-option-shadow:0 1px 2px rgb(var(--ink) / .14),0 0 0 1px rgb(var(--ink) / .06)}'
)
page.wait_for_timeout(300)
before = page.locator(
".lib-segment button.on"
).evaluate_all(metrics_js)
old.evaluate("n=>n.remove()")
page.wait_for_timeout(300)
if theme != "day":
assert before == actual
else:
assert before[0]["background"] == "rgb(20, 17, 9)"
assert (
contrast(
before[0]["background"], before[0]["color"]
)
< 1.2
)
assert not page.evaluate(
"document.documentElement.scrollWidth > innerWidth"
)