mirror of
https://github.com/UniversityOfHelsinkiCS/ohtuilmo.git
synced 2026-10-12 19:03:41 +03:00
fix: force desktop date picker for cypress
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { DesktopDatePicker } from '@mui/x-date-pickers'
|
||||
import { DatePicker, DesktopDatePicker } from '@mui/x-date-pickers'
|
||||
import dayjs from 'dayjs'
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
@@ -12,8 +12,10 @@ export const CustomDatePicker = ({
|
||||
helperText,
|
||||
disabled,
|
||||
}) => {
|
||||
const Picker = typeof window !== 'undefined' && window.Cypress ? DesktopDatePicker : DatePicker
|
||||
|
||||
return (
|
||||
<DesktopDatePicker
|
||||
<Picker
|
||||
disabled={disabled}
|
||||
label={label}
|
||||
value={value ? dayjs(value) : null}
|
||||
|
||||
Reference in New Issue
Block a user