-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into fix/dash_table-missing-key-prop
- Loading branch information
Showing
14 changed files
with
384 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
input:invalid { | ||
input.dash-input:invalid { | ||
outline: solid red; | ||
} | ||
|
||
input:valid { | ||
input.dash-input:valid { | ||
outline: none black; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
components/dash-core-components/tests/integration/input/test_debounce.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
from selenium.common.exceptions import TimeoutException | ||
from selenium.webdriver.support.wait import WebDriverWait | ||
from selenium.webdriver.common.by import By | ||
import pytest | ||
|
||
|
||
def test_debounce_text_by_time(dash_dcc, debounce_text_app): | ||
dash_dcc.start_server(debounce_text_app) | ||
|
||
# expect that a long debounce does not call back in a short amount of time | ||
elem = dash_dcc.find_element("#input-slow") | ||
elem.send_keys("unit test slow") | ||
with pytest.raises(TimeoutException): | ||
WebDriverWait(dash_dcc.driver, timeout=1).until( | ||
lambda d: d.find_element(By.XPATH, "//*[text()='unit test slow']") | ||
) | ||
|
||
# but do expect that it is eventually called | ||
dash_dcc.wait_for_text_to_equal( | ||
"#div-slow", "unit test slow" | ||
), "long debounce is eventually called back" | ||
|
||
# expect that a short debounce calls back within a short amount of time | ||
elem = dash_dcc.find_element("#input-fast") | ||
elem.send_keys("unit test fast") | ||
WebDriverWait(dash_dcc.driver, timeout=1).until( | ||
lambda d: d.find_element(By.XPATH, "//*[text()='unit test fast']") | ||
) | ||
|
||
assert dash_dcc.get_logs() == [] | ||
|
||
|
||
def test_debounce_number_by_time(dash_dcc, debounce_number_app): | ||
dash_dcc.start_server(debounce_number_app) | ||
|
||
# expect that a long debounce does not call back in a short amount of time | ||
elem = dash_dcc.find_element("#input-slow") | ||
elem.send_keys("12345") | ||
with pytest.raises(TimeoutException): | ||
WebDriverWait(dash_dcc.driver, timeout=1).until( | ||
lambda d: d.find_element(By.XPATH, "//*[text()='12345']") | ||
) | ||
|
||
# but do expect that it is eventually called | ||
dash_dcc.wait_for_text_to_equal( | ||
"#div-slow", "12345" | ||
), "long debounce is eventually called back" | ||
|
||
# expect that a short debounce calls back within a short amount of time | ||
elem = dash_dcc.find_element("#input-fast") | ||
elem.send_keys("10000") | ||
WebDriverWait(dash_dcc.driver, timeout=1).until( | ||
lambda d: d.find_element(By.XPATH, "//*[text()='10000']") | ||
) | ||
|
||
assert dash_dcc.get_logs() == [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.