This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 144
support datepickersingle as an uncontrolled component #532
Merged
Merged
Changes from 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
fd7f085
support datepickersingle as an uncontrolled component
chriddyp 115be0a
similar fix for DatePickerRange
chriddyp a127987
include link to dash-renderer issue
chriddyp 070ca04
just include ids in props for now
chriddyp 7df3daf
:hocho:
chriddyp 03735f4
rm state checks for dates
chriddyp 7ab9c35
prettier
chriddyp cd25b59
:bow: thanks @byronz
chriddyp 9359a92
:bug: fixing the onDataChange logic
213bd8b
:lipstick: prettier
bc43c28
:white_check_mark: fix test
5d874a2
:hocho: :bug: fix the bug and improve the test
2c4c8e5
:package: bundles
fb51d5b
:white_check_mark: every month has at least 28
ec1a032
:lipstick: prettier
8eff2f5
:lipstick: flake8
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,8 @@ | |
# export PERCY_PROJECT=plotly/dash-integration-tests | ||
# export PERCY_TOKEN=... | ||
|
||
TIMEOUT = 20 | ||
|
||
TIMEOUT = 10 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😸 |
||
|
||
|
||
class Tests(IntegrationTests): | ||
|
@@ -1658,19 +1659,28 @@ def update_output(start_date, end_date): | |
|
||
self.wait_for_text_to_equal('#date-picker-range-output', 'None - None') | ||
|
||
# updated only one date, callback shouldn't fire and output should be unchanged | ||
dt_length = len(start_date.get_attribute('value')) | ||
start_date.send_keys(dt_length * Keys.BACKSPACE) | ||
start_date.send_keys("1997-05-03") | ||
# using mouse click with fixed day range, this can be improved | ||
# once we start refactoring the test structure | ||
start_date.click() | ||
|
||
sday = self.driver.find_element_by_xpath("//td[text()='1' and @tabindex='0']") | ||
sday.click() | ||
self.wait_for_text_to_equal('#date-picker-range-output', 'None - None') | ||
|
||
# updated both dates, callback should now fire and update output | ||
dt_length = len(end_date.get_attribute('value')) | ||
end_date.send_keys(dt_length * Keys.BACKSPACE) | ||
end_date.send_keys("1997-05-04") | ||
end_date.click() | ||
self.wait_for_text_to_equal( | ||
'#date-picker-range-output', '1997-05-03 - 1997-05-04') | ||
eday = self.driver.find_elements_by_xpath("//td[text()='4']")[1] | ||
eday.click() | ||
|
||
date_tokens = set(start_date.get_attribute('value').split('/')) | ||
date_tokens.update(end_date.get_attribute('value').split('/')) | ||
|
||
self.assertEqual( | ||
set(itertools.chain(*[ | ||
_.split('-') | ||
for _ in self.driver.find_element_by_css_selector( | ||
'#date-picker-range-output').text.split(' - ')]) | ||
), | ||
date_tokens, | ||
"date should match the callback output") | ||
|
||
def test_interval(self): | ||
app = dash.Dash(__name__) | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this swallow the start date in bothdates
mode