-
Notifications
You must be signed in to change notification settings - Fork 832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DateTimePicker] Allow same date selection #2016
[DateTimePicker] Allow same date selection #2016
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/mui-org/material-ui-pickers/evtfd9s8t |
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
@@ -96,4 +96,20 @@ describe('<DateTimePicker />', () => { | |||
fireEvent.click(screen.getByLabelText('open next view')); | |||
expect(screen.getByLabelText('open next view')).toBeDisabled(); | |||
}); | |||
|
|||
it('allows to select the same day and move to the next view', () => { | |||
const onChangeMock = jest.fn() |
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.
Interesting, I didn't realize yet that the CI isn't testing that prettier runs.
Do you want to copy & paste the prettier configuration of the main repository in a follow-up pull request?
const onChangeMock = jest.fn() | |
const onChangeMock = jest.fn(); |
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.
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.
Haha it stopped working after adding command yarn prettier
:D
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.
import { DesktopDateTimePicker, StaticDateTimePicker } from '../DateTimePicker'; | ||
import { fireEvent, screen, waitFor } from '@testing-library/react'; |
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.
We could fix the eslint sort warning at the same time.
); | ||
|
||
fireEvent.click(screen.getByLabelText("Jan 1, 2018")) | ||
expect(onChangeMock).toHaveBeenCalled() |
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.
The test passes without the fix. Could you update it to be failing? (otherwise we are testing something else)
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.
It is failing for me.
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.
You are right, it does fail +1
Closes #2012