-
-
Notifications
You must be signed in to change notification settings - Fork 144
Issue434 - Clear date in DatePickerSingle and DatePickerRange #435
Conversation
- basic unit tests
dash_core_components/metadata.json
Outdated
@@ -2789,6 +2789,9 @@ | |||
}, | |||
{ | |||
"name": "string" | |||
}, | |||
{ | |||
"name": "bool" |
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.
In some previous commit the metadata was not updated correctly.
@@ -22,6 +22,8 @@ import Tab from './components/Tab.react'; | |||
import Store from './components/Store.react'; | |||
import LogoutButton from './components/LogoutButton.react'; | |||
|
|||
import './components/css/[email protected]'; |
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.
Moving this style dependency to the top level -- jest is not able to handle css files correctly atm
case 'Undefined': | ||
return; | ||
case 'Null': | ||
dest[key] = null; |
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.
Common logic between Single and Range + the new Null
case
expect(dps.props().start_date).toEqual(props.start_date); | ||
expect(dps.state().start_date).not.toEqual(null); | ||
}); | ||
}); |
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.
Basic tests for range: passing null sets null in the state, otherwise it sets a value (do not care about the exact value atm, just differentiating the 2 cases)
expect(dps.props()).toBeDefined(); | ||
expect(dps.props().date).toEqual(props.date); | ||
expect(dps.state().date).not.toEqual(null); | ||
}); |
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.
Basic tests for single: passing null sets null in the state, otherwise it sets a value (do not care about the exact value atm, just differentiating the 2 cases)
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.
Looks great, nice fix, nice tests, nice 🌴
💃
…-clear-date # Conflicts: # CHANGELOG.md # dash_core_components/dash_core_components.dev.js # dash_core_components/dash_core_components.dev.js.map # dash_core_components/dash_core_components.min.js # dash_core_components/dash_core_components.min.js.map
Fixes #434
Currently, DatePickerSingle and DatePickerRange do not process
null
dates correctly.Handle the null case by assigning the value as-is to the underlying react-dates component instead of wrapping it with moment.