Skip to content

Commit 566107b

Browse files
committed
Fix logic issue found in tests
1 parent 492e70f commit 566107b

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

components/dash-core-components/src/fragments/RangeSlider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export default function RangeSlider(props: RangeSliderProps) {
152152
);
153153

154154
const maxDecimalChars = Math.min(
155-
String(stepValue).split('.')[1]?.length + 1 ?? 0,
155+
(String(stepValue).split('.')[1]?.length ?? -1) + 1,
156156
3
157157
);
158158

components/dash-core-components/tests/integration/misc/test_persistence.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def make_output(*args):
118118
]
119119

120120
dash_dcc.start_server(app)
121+
dash_dcc.driver.set_window_size(1024, 768)
121122
dash_dcc.wait_for_text_to_equal("#settings", json.dumps(initial_settings))
122123

123124
dash_dcc.find_element("#checklist label:last-child input").click() # 🚀

components/dash-core-components/tests/integration/sliders/test_sliders.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ def update_output(rng):
6060
dash_dcc.wait_for_text_to_equal("#out", "You have selected 5-15")
6161

6262
slider = dash_dcc.find_element("#rangeslider")
63-
dash_dcc.click_at_coord_fractions(slider, 0.15, 0.25)
63+
dash_dcc.click_at_coord_fractions(slider, 0.2, 0.25)
6464
dash_dcc.wait_for_text_to_equal("#out", "You have selected 3-15")
65-
dash_dcc.click_at_coord_fractions(slider, 0.5, 0.25)
65+
dash_dcc.click_at_coord_fractions(slider, 0.51, 0.25)
6666
dash_dcc.wait_for_text_to_equal("#out", "You have selected 3-10")
6767

6868
assert dash_dcc.get_logs() == []

tests/integration/callbacks/test_wildcards.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,18 +538,18 @@ def update_selected_values(values):
538538
return str(values)
539539

540540
dash_duo.start_server(app)
541-
dash_duo.select_dcc_dropdown(".dash-dropdown:nth-child(3)", index=2)
541+
dash_duo.select_dcc_dropdown(".dash-dropdown-wrapper:nth-child(3) button", index=2)
542542

543543
dash_duo.wait_for_text_to_equal("#selected-values", "[None, None, 'option2-2']")
544544

545545
dash_duo.wait_for_element("#refresh-options").click()
546546

547-
dash_duo.select_dcc_dropdown(".dash-dropdown:nth-child(2)", index=2)
547+
dash_duo.select_dcc_dropdown(".dash-dropdown-wrapper:nth-child(2) button", index=2)
548548
dash_duo.wait_for_text_to_equal(
549549
"#selected-values", "[None, 'option1-2', 'option2-2']"
550550
)
551551

552-
dash_duo.select_dcc_dropdown(".dash-dropdown:nth-child(1)", index=2)
552+
dash_duo.select_dcc_dropdown(".dash-dropdown-wrapper:nth-child(1) button", index=2)
553553
dash_duo.wait_for_text_to_equal(
554554
"#selected-values", "['option0-2', 'option1-2', 'option2-2']"
555555
)

0 commit comments

Comments
 (0)