= withDefaul
setOpenView('hours')}
selected={openView === 'hours'}
@@ -125,17 +131,37 @@ export const DateTimePickerToolbar: React.FC = withDefaul
typographyClassName={classes.timeTypography}
/>
-
+
setOpenView('minutes')}
selected={openView === 'minutes'}
value={date ? utils.format(date, 'minutes') : '--'}
typographyClassName={classes.timeTypography}
/>
+
+ {hasSeconds && (
+ <>
+
+
+ setOpenView('seconds')}
+ selected={openView === 'seconds'}
+ value={date ? utils.format(date, 'seconds') : '--'}
+ typographyClassName={classes.timeTypography}
+ />
+ >
+ )}
)}
diff --git a/lib/src/__tests__/DateTimePickerRoot.test.tsx b/lib/src/__tests__/DateTimePickerRoot.test.tsx
index 4f5e5b2b2..076ab9d38 100644
--- a/lib/src/__tests__/DateTimePickerRoot.test.tsx
+++ b/lib/src/__tests__/DateTimePickerRoot.test.tsx
@@ -71,3 +71,28 @@ describe('e2e - DateTimePicker', () => {
toHaveBeenCalledExceptMoment(onChangeMock, [utilsToUse.date('2018-01-01T12:00:00.000Z')]);
});
});
+
+describe('e2e - DateTimePicker with seconds', () => {
+ it('Should render hour view', () => {
+ const onChangeMock = jest.fn();
+
+ const component = mount(
+ }
+ views={['year', 'month', 'date', 'hours', 'minutes', 'seconds']}
+ />
+ );
+
+ component
+ .find('ToolbarButton')
+ .at(4)
+ .simulate('click');
+
+ expect(component.find('ClockView').props().type).toBe('seconds');
+ });
+});