Skip to content

Commit 228cd49

Browse files
committed
Add unit tests for disableClock flag
1 parent b0bb383 commit 228cd49

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/__tests__/DateTimePicker.jsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,18 @@ describe('DateTimePicker', () => {
132132
expect(clock).toHaveLength(1);
133133
});
134134

135+
it('does not render Clock component when given disableClock & isClockOpen flags', () => {
136+
const component = mount(
137+
<DateTimePicker disableClock isClockOpen />
138+
);
139+
140+
const dateTimeInput = component.find('DateTimeInput');
141+
const clock = component.find('Clock');
142+
143+
expect(dateTimeInput).toHaveLength(1);
144+
expect(clock).toHaveLength(0);
145+
});
146+
135147
it('opens Calendar component when given isCalendarOpen flag by changing props', () => {
136148
const component = mount(
137149
<DateTimePicker />

0 commit comments

Comments
 (0)