Skip to content
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

Merged
merged 2 commits into from
Jul 22, 2020

Conversation

dmtrKovalenko
Copy link
Member

Closes #2012

@dmtrKovalenko dmtrKovalenko added the bug 🐛 Something isn't working label Jul 21, 2020
@vercel
Copy link

vercel bot commented Jul 21, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/mui-org/material-ui-pickers/evtfd9s8t
✅ Preview: https://material-ui-pic-git-bugfix-date-time-picker-same-date-se-2ca6bb.mui-org.vercel.app

@cypress
Copy link

cypress bot commented Jul 21, 2020



Test summary

78 0 3 0


Run details

Project material-ui-pickers
Status Passed
Commit 0a66ec6
Started Jul 21, 2020 12:22 PM
Ended Jul 21, 2020 12:24 PM
Duration 01:40 💡
OS Linux Debian - 10.0
Browser Chrome 80

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()
Copy link
Member

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?

Suggested change
const onChangeMock = jest.fn()
const onChangeMock = jest.fn();

Copy link
Member Author

@dmtrKovalenko dmtrKovalenko Jul 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
It is checking but broken :)

Copy link
Member Author

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +5 to 6
import { DesktopDateTimePicker, StaticDateTimePicker } from '../DateTimePicker';
import { fireEvent, screen, waitFor } from '@testing-library/react';
Copy link
Member

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()
Copy link
Member

@oliviertassinari oliviertassinari Jul 21, 2020

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)

Copy link
Member Author

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.

Copy link
Member

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

@dmtrKovalenko dmtrKovalenko merged commit 32b7483 into next Jul 22, 2020
@dmtrKovalenko dmtrKovalenko deleted the bugfix/date-time-picker-same-date-selection branch July 22, 2020 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Version 4.0.0-alpha.10 not working correctly with DateTimePicker. The selection of same day not working!
2 participants