-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[scheduler] Add tests for eventCalendarEventSelectors
#20160
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
[scheduler] Add tests for eventCalendarEventSelectors
#20160
Conversation
| isResizable: createSelector( | ||
| (state: State, eventId: CalendarEventId, surfaceType: EventSurfaceType) => { | ||
| if (schedulerSelectors.isEventReadOnly(state, eventId) || !state.areEventsDraggable) { | ||
| if (schedulerSelectors.isEventReadOnly(state, eventId) || !state.areEventsResizable) { |
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.
🕵️
|
Deploy preview: https://deploy-preview-20160--material-ui-x.netlify.app/ Bundle size report
|
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
1 similar comment
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
packages/x-scheduler-headless/src/event-calendar-selectors/eventCalendarEventSelectors.test.ts
Outdated
Show resolved
Hide resolved
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.
Left a small comment, love this improvement! 🚢
Part of #19010
I introduced 2 small utilities to easily have fully functional tests.
When we test something that can be controlled by the parameters, I think it's more reliable that hardcoding the test changes.
When we test something that can't be controlled by the parameters (for example the placeholder), then at least we only have to override this part of the UI. But I think we could introduce other utilities in the future to help.
Not sure if we should also use the builder pattern for the whole state.
That could be interesting in the future to have something more powerful.