Skip to content

Commit c5cd74b

Browse files
committed
loosen table scroll tests
seems current chrome shifts something half a pixel?
1 parent 12346f5 commit c5cd74b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

components/dash-table/tests/selenium/test_scrolling.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ def test_scrol001_fixed_alignment(test, fixed_rows, fixed_columns, ops):
7272
"return parseFloat(getComputedStyle(document.querySelector('#table .cell-0-0')).width) || 0;"
7373
)
7474

75-
assert -get_margin(test) == fixed_width
75+
assert -get_margin(test) == pytest.approx(fixed_width, abs=1)
7676

7777
scroll_by(test, 200)
7878

79-
wait.until(lambda: -get_margin(test) == fixed_width + 200, 3)
79+
wait.until(lambda: -get_margin(test) == pytest.approx(fixed_width + 200, abs=1), 3)
8080

8181
scroll_by(test, -200)
8282

83-
wait.until(lambda: -get_margin(test) == fixed_width, 3)
83+
wait.until(lambda: -get_margin(test) == pytest.approx(fixed_width, abs=1), 3)
8484
assert test.get_log_errors() == []
8585

8686

@@ -121,12 +121,12 @@ def test_scrol002_edit_navigate(test, fixed_rows, fixed_columns, ops):
121121
test.send_keys("abc" + Keys.ENTER)
122122

123123
wait.until(lambda: target.cell(1, 3).is_selected(), 3)
124-
wait.until(lambda: -get_margin(test) == fixed_width + get_scroll(test), 3)
124+
wait.until(lambda: -get_margin(test) == pytest.approx(fixed_width + get_scroll(test), abs=1), 3)
125125

126126
# alignment is ok after navigating
127127
test.send_keys(Keys.ARROW_DOWN)
128128
test.send_keys(Keys.ARROW_RIGHT)
129129

130130
wait.until(lambda: target.cell(2, 4).is_selected(), 3)
131-
wait.until(lambda: -get_margin(test) == fixed_width + get_scroll(test), 3)
131+
wait.until(lambda: -get_margin(test) == pytest.approx(fixed_width + get_scroll(test), abs=1), 3)
132132
assert test.get_log_errors() == []

0 commit comments

Comments
 (0)