test(HEL-845): wait for settled before and after colors
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -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"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user