@spothero/ui 15.1.0 → 15.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/CHANGELOG.md +0 -18
  2. package/package.json +2 -3
  3. package/styles/v2/components/Modal/styles/dialogContainer.js +0 -1
  4. package/styles/v2/components/Radio/Radio.jsx +1 -1
  5. package/styles/v2/components/Radio/RadioGroup.jsx +1 -1
  6. package/v2/index.js +1 -1
  7. package/v2/index.js.map +1 -1
  8. package/styles/Alert/Alert.jsx +0 -45
  9. package/styles/Alert/Alert.spec.js +0 -85
  10. package/styles/AutoSuggestInput/AutoSuggestInput.jsx +0 -429
  11. package/styles/AutoSuggestInput/AutoSuggestInput.spec.js +0 -132
  12. package/styles/AutoSuggestInput/AutoSuggestItem.jsx +0 -61
  13. package/styles/AutoSuggestInput/AutoSuggestList.jsx +0 -85
  14. package/styles/Badge/Badge.jsx +0 -24
  15. package/styles/Badge/Badge.spec.js +0 -43
  16. package/styles/Chart/Chart.jsx +0 -185
  17. package/styles/Chart/Chart.spec.js +0 -369
  18. package/styles/Checkbox/Checkbox.jsx +0 -159
  19. package/styles/Checkbox/Checkbox.spec.js +0 -142
  20. package/styles/DateTime/DatePicker.jsx +0 -281
  21. package/styles/DateTime/DatePicker.spec.js +0 -186
  22. package/styles/DateTime/DatePickerCalendar.jsx +0 -170
  23. package/styles/DateTime/DatePickerCalendarNavigation.jsx +0 -44
  24. package/styles/DateTime/DatePickerCalendarWithRange.jsx +0 -218
  25. package/styles/DateTime/DateTimePicker.jsx +0 -266
  26. package/styles/DateTime/DateTimePicker.spec.js +0 -60
  27. package/styles/DateTime/DateTimeRangePicker.jsx +0 -629
  28. package/styles/DateTime/DateTimeRangePicker.spec.js +0 -425
  29. package/styles/DateTime/TimePicker.jsx +0 -158
  30. package/styles/DateTime/TimePicker.spec.js +0 -148
  31. package/styles/DateTime/date-time-assertions.js +0 -89
  32. package/styles/DateTime/index.js +0 -6
  33. package/styles/ErrorBoundary/ErrorBoundary.jsx +0 -76
  34. package/styles/ErrorBoundary/ErrorBoundary.spec.js +0 -72
  35. package/styles/Flyout/Flyout.jsx +0 -147
  36. package/styles/Flyout/Flyout.spec.js +0 -117
  37. package/styles/Form/Form.jsx +0 -151
  38. package/styles/Form/Form.spec.js +0 -148
  39. package/styles/Form/FormElementError.jsx +0 -18
  40. package/styles/Form/FormGroup.jsx +0 -32
  41. package/styles/Form/FormGroupError.jsx +0 -24
  42. package/styles/Form/index.js +0 -4
  43. package/styles/GooglePlacesSearchInput/GooglePlacesSearchInput.jsx +0 -215
  44. package/styles/GooglePlacesSearchInput/GooglePlacesSearchInput.spec.js +0 -213
  45. package/styles/GooglePlacesSearchInput/PoweredByGoogle.jsx +0 -43
  46. package/styles/GooglePlacesSearchInput/index.js +0 -2
  47. package/styles/HorizontalRule/HorizontalRule.jsx +0 -36
  48. package/styles/HorizontalRule/HorizontalRule.spec.js +0 -94
  49. package/styles/Label/Label.jsx +0 -22
  50. package/styles/Label/Label.spec.js +0 -11
  51. package/styles/Notification/Notification.jsx +0 -117
  52. package/styles/Notification/Notification.spec.js +0 -154
  53. package/styles/Notification/NotificationContainer.jsx +0 -90
  54. package/styles/Notification/NotificationPropTypes.js +0 -20
  55. package/styles/Notification/index.js +0 -2
  56. package/styles/PasswordControl/PasswordControl.jsx +0 -197
  57. package/styles/PasswordControl/PasswordControl.spec.js +0 -236
  58. package/styles/Portal/Portal.jsx +0 -65
  59. package/styles/Portal/Portal.spec.js +0 -45
  60. package/styles/PulseLoader/PulseLoader.jsx +0 -71
  61. package/styles/PulseLoader/PulseLoader.spec.js +0 -63
  62. package/styles/Radio/Radio.jsx +0 -114
  63. package/styles/Radio/Radio.spec.js +0 -128
  64. package/styles/Radio/RadioGroup.jsx +0 -105
  65. package/styles/Radio/index.js +0 -2
  66. package/styles/RenderInBody/RenderInBody.jsx +0 -56
  67. package/styles/RenderInBody/RenderInBody.spec.js +0 -24
  68. package/styles/Select/Select.jsx +0 -251
  69. package/styles/Select/Select.spec.js +0 -254
  70. package/styles/Select/SelectItemPropTypes.js +0 -19
  71. package/styles/Select/index.js +0 -2
  72. package/styles/SelectControlled/SelectControlled.jsx +0 -250
  73. package/styles/SelectControlled/SelectControlled.spec.js +0 -290
  74. package/styles/SelectControlled/index.js +0 -1
  75. package/styles/Sprite/Sprite.jsx +0 -16
  76. package/styles/Sprite/Sprite.spec.js +0 -11
  77. package/styles/Tabs/Tab.jsx +0 -38
  78. package/styles/Tabs/TabContent.jsx +0 -46
  79. package/styles/Tabs/TabNavigation.jsx +0 -64
  80. package/styles/Tabs/TabPanel.jsx +0 -30
  81. package/styles/Tabs/Tabs.jsx +0 -87
  82. package/styles/Tabs/Tabs.spec.js +0 -201
  83. package/styles/Tabs/index.js +0 -5
  84. package/styles/TextArea/TextArea.jsx +0 -137
  85. package/styles/TextArea/TextArea.spec.js +0 -111
  86. package/styles/TextInput/TextInput.jsx +0 -159
  87. package/styles/TextInput/TextInput.spec.js +0 -263
  88. package/styles/TextInput/TextInputPropTypes.js +0 -88
  89. package/styles/TextInput/index.js +0 -2
  90. package/styles/Tooltip/Tooltip.jsx +0 -230
  91. package/styles/Tooltip/Tooltip.spec.js +0 -170
@@ -1,218 +0,0 @@
1
- import React, {Component} from 'react';
2
- import PropTypes from 'prop-types';
3
- import classNames from 'classnames';
4
- import moment from 'moment';
5
- import DayPicker, {DateUtils as DayPickerDateUtils} from 'react-day-picker';
6
- import DateUtils from '@spothero/utils/date';
7
- import DatePickerCalendarNavigation from './DatePickerCalendarNavigation';
8
-
9
- const DATE = new Date();
10
- const DATE_FORMAT = 'MM/DD/YYYY';
11
-
12
- export default class DatePickerCalendarWithRange extends Component {
13
- static propTypes = {
14
- /** Additional class(es) to add to the component. */
15
- className: PropTypes.string,
16
- /**
17
- * Function to execute when the selected date changes.
18
- *
19
- * @param {Object} properties - Updated date properties.
20
- * @param {String} properties.selectedStartDate - The selected start date in the format 'MM/DD/YYYY'.
21
- * @param {String} properties.selectedEndDate - The selected end date in the format 'MM/DD/YYYY'.
22
- */
23
- onChange: PropTypes.func,
24
- /** A string in the format 'MM/DD/YYYY' representing the start of a date range which should be selected on the calendar. */
25
- selectedStartDate: PropTypes.string,
26
- /** A string in the format 'MM/DD/YYYY' representing the end of a date range which should be selected on the calendar. */
27
- selectedEndDate: PropTypes.string,
28
- /** A string which might be empty, 'start', or 'end' to denote which boundary to adjust (after a valid range has been selected). */
29
- adjustStartOrEnd: PropTypes.string,
30
- /** The number of months to display on the calendar. */
31
- numberOfMonths: PropTypes.number,
32
- /** Array of strings to use as weekday titles, beginning with Sunday. */
33
- weekdayTitles: PropTypes.array,
34
- /** A string in the format 'MM/DD/YYYY' representing the date where any day prior is disabled. */
35
- disableBefore: PropTypes.string,
36
- /** A string in the format 'MM/DD/YYYY' representing the date where any day past is disabled. */
37
- disableAfter: PropTypes.string,
38
- /** Whether to set the initial month to show in the calendar to the same month as the selected day falls within when a selectedDate is passed. */
39
- overrideInitialMonthWithSelected: PropTypes.bool,
40
- };
41
- static defaultProps = {
42
- numberOfMonths: 1,
43
- weekdayTitles: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
44
- overrideInitialMonthWithSelected: true,
45
- };
46
-
47
- constructor(props) {
48
- super(props);
49
-
50
- const {selectedStartDate, selectedEndDate} = props;
51
-
52
- this.state = {
53
- selectedStartDate: selectedStartDate
54
- ? DateUtils.getAsDate(selectedStartDate)
55
- : null,
56
- selectedEndDate: selectedEndDate
57
- ? DateUtils.getAsDate(selectedEndDate)
58
- : null,
59
- };
60
- }
61
-
62
- _onDaySelected = (day, {selected, disabled}, evt) => {
63
- if (disabled) {
64
- return;
65
- }
66
-
67
- const {onChange} = this.props;
68
- const {
69
- to: selectedStartDate,
70
- from: selectedEndDate,
71
- } = this._updateDateRange(day);
72
-
73
- this.setState({selectedStartDate, selectedEndDate});
74
-
75
- if (onChange) {
76
- onChange({
77
- selectedStartDate: selectedStartDate
78
- ? moment(selectedStartDate).format(DATE_FORMAT)
79
- : null,
80
- selectedEndDate: selectedEndDate
81
- ? moment(selectedEndDate).format(DATE_FORMAT)
82
- : null,
83
- });
84
- }
85
- };
86
-
87
- _updateDateRange = newDate => {
88
- const {adjustStartOrEnd} = this.props;
89
- const {
90
- selectedStartDate: prevSelectedStartDate,
91
- selectedEndDate: prevSelectedEndDate,
92
- } = this.state;
93
- let newStartDate;
94
- let newEndDate;
95
-
96
- if (!prevSelectedStartDate || !prevSelectedEndDate) {
97
- // if both start and end dates aren't populated, use the default logic
98
- const {from, to} = DayPickerDateUtils.addDayToRange(newDate, {
99
- from: prevSelectedStartDate,
100
- to: prevSelectedEndDate,
101
- });
102
-
103
- newStartDate = from;
104
- newEndDate = to;
105
- } else if (adjustStartOrEnd === 'start') {
106
- // if start input is focused, update start date and clear end date
107
- newStartDate = newDate;
108
- newEndDate = null;
109
- } else if (
110
- adjustStartOrEnd === 'end' &&
111
- !DayPickerDateUtils.isDayBefore(newDate, prevSelectedStartDate)
112
- ) {
113
- // if end input is focused and newDate >= prevSelectedStartDate, update end date
114
- newStartDate = prevSelectedStartDate;
115
- newEndDate = newDate;
116
- } else if (
117
- adjustStartOrEnd === 'end' &&
118
- DayPickerDateUtils.isDayBefore(newDate, prevSelectedStartDate)
119
- ) {
120
- // if end input is focused and newDate < prevSelectedStartDate, update start date and clear end date
121
- newStartDate = newDate;
122
- newEndDate = null;
123
- }
124
-
125
- return {
126
- to: newStartDate,
127
- from: newEndDate,
128
- };
129
- };
130
-
131
- _renderDayMarkup = day => {
132
- const m = moment(day);
133
- const date = `${m.format('MM')}/${m.format('DD')}/${m.format('YYYY')}`;
134
-
135
- return (
136
- <span className="DatePicker-Day--wrapper">
137
- <span data-date={date}>{day.getDate()}</span>
138
- </span>
139
- );
140
- };
141
-
142
- render() {
143
- const {
144
- className,
145
- numberOfMonths,
146
- weekdayTitles,
147
- disableBefore,
148
- disableAfter,
149
- overrideInitialMonthWithSelected,
150
- } = this.props;
151
- const {selectedStartDate, selectedEndDate} = this.state;
152
- const classes = classNames(
153
- 'DatePicker-calendar',
154
- 'DatePicker-calendar-with-range',
155
- className
156
- );
157
- let firstMonth = DATE;
158
- let fromMonth = DATE;
159
- let toMonth = null;
160
-
161
- if (disableBefore) {
162
- const beforeDate = DateUtils.getAsDate(disableBefore);
163
-
164
- if (fromMonth) {
165
- if (DateUtils.isAfter(beforeDate, fromMonth)) {
166
- fromMonth = beforeDate;
167
- }
168
- } else {
169
- fromMonth = beforeDate;
170
- }
171
-
172
- firstMonth = fromMonth;
173
- }
174
-
175
- if (disableAfter) {
176
- toMonth = DateUtils.getAsDate(disableAfter);
177
- }
178
-
179
- if (selectedStartDate && overrideInitialMonthWithSelected) {
180
- firstMonth = selectedStartDate;
181
- }
182
-
183
- return (
184
- <div className={classes}>
185
- <DayPicker
186
- selectedDays={[
187
- selectedStartDate,
188
- {
189
- from: selectedStartDate,
190
- to: selectedEndDate,
191
- },
192
- ]}
193
- modifiers={{
194
- start: selectedStartDate,
195
- end: selectedEndDate,
196
- 'start-without-end': day =>
197
- DayPickerDateUtils.isSameDay(
198
- day,
199
- selectedStartDate
200
- ) && !selectedEndDate,
201
- }}
202
- disabledDays={{
203
- before: fromMonth,
204
- ...(toMonth && {after: toMonth}),
205
- }}
206
- fromMonth={fromMonth}
207
- toMonth={toMonth}
208
- initialMonth={firstMonth}
209
- onDayClick={this._onDaySelected}
210
- numberOfMonths={numberOfMonths}
211
- renderDay={this._renderDayMarkup}
212
- weekdaysShort={weekdayTitles}
213
- navbarElement={<DatePickerCalendarNavigation />}
214
- />
215
- </div>
216
- );
217
- }
218
- }
@@ -1,266 +0,0 @@
1
- import React, {Component} from 'react';
2
- import PropTypes from 'prop-types';
3
- import classNames from 'classnames';
4
- import DatePicker from './DatePicker';
5
- import TimePicker from './TimePicker';
6
-
7
- export default class DateTimePicker extends Component {
8
- static propTypes = {
9
- /** Additional class(es) to add to the component. */
10
- className: PropTypes.string,
11
- /** A unique ID which is used to identify this element for accessibility purposes on the client as well as the server. */
12
- id: PropTypes.string.isRequired,
13
- /** Additional class(es) to add to the the underlying calendar component. */
14
- calendarClassName: PropTypes.string,
15
- /** Whether to show the calendar and clock icons in the selectors. */
16
- useIcons: PropTypes.bool,
17
- /** If using the icons, whether they should appear on the left or right side of the input fields. */
18
- iconPosition: PropTypes.oneOf(['left', 'right']),
19
- /** Whether the DateTimePicker is disabled or not. */
20
- disabled: PropTypes.bool,
21
- /** A unique name which is used to identify the date element. If belonging to a form this is used as the key for serialization and is required. */
22
- dateName: PropTypes.string,
23
- /** A unique name which is used to identify the time element. If belonging to a form this is used as the key for serialization and is required. */
24
- timeName: PropTypes.string,
25
- /** A custom label (typically a Label component) to display above the date input. */
26
- dateLabel: PropTypes.element,
27
- /** A placeholder to display in the date input. */
28
- datePlaceholder: PropTypes.string,
29
- /** A custom label (typically a Label component) to display above the time selector. */
30
- timeLabel: PropTypes.element,
31
- /** A placeholder to display in the time input. */
32
- timePlaceholder: PropTypes.string,
33
- /** A function that alters how the selected date is displayed in the input field. Takes the date in MM/DD/YYYY format and should return a string with the new format. */
34
- dateDisplayFormat: PropTypes.func,
35
- /** The <a href="https://momentjs.com/docs/#/displaying/format/" target="_blank">format</a> to display the time in. */
36
- timeDisplayFormat: PropTypes.string,
37
- /** A string in the format 'MM/DD/YYYY' representing the date which should be selected. */
38
- selectedDate: PropTypes.string,
39
- /** A string in the format of 'hh:mm A' representing the time which should be selected. */
40
- selectedTime: PropTypes.string,
41
- /** Whether to set the initial month to show in the calendar to the same month as the selected day falls within when a day is selected. */
42
- overrideInitialMonthWithSelected: PropTypes.bool,
43
- /** The multiplier with which to create selectable times in the dropdown (in minutes). */
44
- timeStep: PropTypes.number,
45
- /**
46
- * Where the applicable tooltip should be anchored to.
47
- *
48
- * @deprecated Tooltip support was removed in v6.0.0.
49
- */
50
- tooltipType: PropTypes.oneOf(['none', 'date', 'time']),
51
- /**
52
- * The message to display inside of the tooltip.
53
- *
54
- * @deprecated Tooltip support was removed in v6.0.0.
55
- */
56
- tooltipMessage: PropTypes.string,
57
- /**
58
- * Where to position the tooltip in relation to the triggering element.
59
- *
60
- * @deprecated Tooltip support was removed in v6.0.0.
61
- */
62
- tooltipPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
63
- /**
64
- * Whether to reposition the tooltip when it moves, be it via window resize or scrolling or whatever moves it.
65
- *
66
- * @deprecated Tooltip support was removed in v6.0.0.
67
- */
68
- updateTooltipPositionOnMove: PropTypes.bool,
69
- /** Whether to disable days before today. */
70
- disablePast: PropTypes.bool,
71
- /** A string in the format 'MM/DD/YYYY' representing the date where days before it should be disabled in the calendar. */
72
- disableDateBefore: PropTypes.string,
73
- /** A string in the format 'MM/DD/YYYY' representing the date where days after it should be disabled in the calendar. */
74
- disableDateAfter: PropTypes.string,
75
- /** A string in the format 'hh:mm A' representing the time where times before it should be disabled in the selector. */
76
- disableTimeBefore: PropTypes.string,
77
- /** A string in the format 'hh:mm A' representing the time where times after it should be disabled in the selector. */
78
- disableTimeAfter: PropTypes.string,
79
- /** Puts the calendar in the center of the page with a shim behind it. */
80
- useTetherShim: PropTypes.bool,
81
- /**
82
- * A function to execute after the tooltip has been hidden.
83
- *
84
- * @deprecated Tooltip support was removed in v6.0.0.
85
- */
86
- onTooltipHidden: PropTypes.func,
87
- /**
88
- * Function to execute when the selected date and/or time changes.
89
- *
90
- * @param {String} selectedDate - The selected date in the format 'MM/DD/YYYY'.
91
- * @param {String} selectedTime - The selected time in the format 'hh:mm A'.
92
- */
93
- onChange: PropTypes.func,
94
- };
95
- static defaultProps = {
96
- useIcons: true,
97
- timeStep: 30,
98
- disablePast: true,
99
- overrideInitialMonthWithSelected: true,
100
- iconPosition: 'right',
101
- };
102
-
103
- constructor(props) {
104
- super(props);
105
-
106
- const {
107
- id,
108
- selectedDate,
109
- selectedTime,
110
- tooltipType,
111
- tooltipMessage,
112
- tooltipPosition,
113
- updateTooltipPositionOnMove,
114
- onTooltipHidden,
115
- } = props;
116
-
117
- if (!id) {
118
- throw new Error(
119
- `The prop 'id' is required to make DateTimePicker accessible for users using assistive technologies such as screen readers. Check the render method of DateTimePicker.`
120
- );
121
- }
122
-
123
- if (
124
- tooltipType ||
125
- tooltipMessage ||
126
- tooltipPosition ||
127
- updateTooltipPositionOnMove ||
128
- onTooltipHidden
129
- ) {
130
- throw new Error(
131
- 'Tooltip support inside of DateTimePicker was removed in v6.0.0. Use dateNode and timeNode getters in a parent component to add tooltips manually as necessary.'
132
- );
133
- }
134
-
135
- this.state = {
136
- selectedDate,
137
- selectedTime,
138
- };
139
- }
140
-
141
- componentDidUpdate(prevProps, prevState) {
142
- const {onChange} = this.props;
143
- const {selectedDate, selectedTime} = this.state;
144
- const {
145
- selectedDate: prevSelectedDate,
146
- selectedTime: prevSelectedTime,
147
- } = prevState;
148
-
149
- if (
150
- (selectedDate !== prevSelectedDate ||
151
- selectedTime !== prevSelectedTime) &&
152
- onChange
153
- ) {
154
- onChange({
155
- selectedDate,
156
- selectedTime,
157
- });
158
- }
159
- }
160
-
161
- _onDateChange = selectedDate => {
162
- this.setState({
163
- selectedDate,
164
- });
165
- };
166
-
167
- _onTimeChange = selectedTime => {
168
- this.setState({
169
- selectedTime,
170
- });
171
- };
172
-
173
- /**
174
- * Getter for the date picker input DOM element.
175
- *
176
- * @public
177
- * @returns {Element} - The input element.
178
- */
179
- get dateNode() {
180
- return this._datePicker.node;
181
- }
182
-
183
- /**
184
- * Getter for the time picker select DOM element.
185
- *
186
- * @public
187
- * @returns {Element} - The select element.
188
- */
189
- get timeNode() {
190
- return this._timePicker.node;
191
- }
192
-
193
- render() {
194
- const {
195
- className,
196
- id,
197
- useIcons,
198
- iconPosition,
199
- dateLabel,
200
- dateDisplayFormat,
201
- timeDisplayFormat,
202
- datePlaceholder,
203
- timeLabel,
204
- timePlaceholder,
205
- dateName,
206
- timeName,
207
- timeStep,
208
- calendarClassName,
209
- overrideInitialMonthWithSelected,
210
- disablePast,
211
- disableDateBefore,
212
- disableDateAfter,
213
- disableTimeBefore,
214
- disableTimeAfter,
215
- useTetherShim,
216
- disabled,
217
- } = this.props;
218
- const {selectedDate, selectedTime} = this.state;
219
- const classes = classNames('DateTimePicker', className);
220
-
221
- return (
222
- <div className={classes}>
223
- <DatePicker
224
- ref={node => {
225
- this._datePicker = node;
226
- }}
227
- id={id}
228
- name={dateName}
229
- displayFormat={dateDisplayFormat}
230
- calendarClassName={calendarClassName}
231
- useIcon={useIcons}
232
- iconPosition={iconPosition}
233
- disabled={disabled}
234
- label={dateLabel}
235
- placeholder={datePlaceholder}
236
- selectedDate={selectedDate}
237
- overrideInitialMonthWithSelected={
238
- overrideInitialMonthWithSelected
239
- }
240
- onChange={this._onDateChange}
241
- disablePast={disablePast}
242
- disableBefore={disableDateBefore}
243
- disableAfter={disableDateAfter}
244
- useTetherShim={useTetherShim}
245
- />
246
- <TimePicker
247
- ref={node => {
248
- this._timePicker = node;
249
- }}
250
- name={timeName}
251
- useIcon={useIcons}
252
- displayFormat={timeDisplayFormat}
253
- iconPosition={iconPosition}
254
- disabled={disabled}
255
- label={timeLabel}
256
- placeholder={timePlaceholder}
257
- selectedTime={selectedTime}
258
- step={timeStep}
259
- disableBefore={disableTimeBefore}
260
- disableAfter={disableTimeAfter}
261
- onChange={this._onTimeChange}
262
- />
263
- </div>
264
- );
265
- }
266
- }
@@ -1,60 +0,0 @@
1
- import moment from 'moment';
2
-
3
- describe('<DateTimePicker />', () => {
4
- context('Display', () => {
5
- context('Default', () => {
6
- const dateTodayFormatted = moment().format('MM/DD/YYYY');
7
-
8
- beforeEach(() => {
9
- cy.visitStory('v1/DateTimePicker/Display', 'Default', {
10
- onBeforeLoad: contentWindow => {
11
- contentWindow.onDateTimePickerChange = ({
12
- selectedDate,
13
- selectedTime,
14
- }) => {
15
- console.log(
16
- 'selected date and time:',
17
- selectedDate,
18
- selectedTime
19
- ); // eslint-disable-line no-console
20
- };
21
-
22
- cy.stub(contentWindow, 'onDateTimePickerChange').as(
23
- 'onChange'
24
- );
25
- },
26
- });
27
- });
28
-
29
- it('Renders properly', () => {
30
- cy.get('.DateTimePicker')
31
- .should('have.class', 'DateTimePicker')
32
- .get('select')
33
- .get('input');
34
- });
35
-
36
- it('Fires `onChange` properly', () => {
37
- cy.get('input')
38
- .focus()
39
- .get('.DayPicker-Day--today')
40
- .click()
41
- .get('select')
42
- .select('03:00 AM')
43
- .get('@onChange')
44
- .should('be.calledWith', {
45
- selectedDate: dateTodayFormatted,
46
- selectedTime: '03:00 AM',
47
- });
48
- });
49
- });
50
-
51
- context('Classes', () => {
52
- it('Has custom class names', () => {
53
- cy.visitStory('v1/DateTimePicker/Display', 'Classes')
54
- .get('.DateTimePicker')
55
- .should('have.class', 'DateTimePickerClasses')
56
- .should('have.class', 'DateTimePickerClasses2');
57
- });
58
- });
59
- });
60
- });