Skip to content

Commit 9929d57

Browse files
committed
Improve unit test stability
1 parent 0858d58 commit 9929d57

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/DateTimePicker.spec.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,23 +158,23 @@ describe('DateTimePicker', () => {
158158

159159
const { container } = render(<DateTimePicker className={className} />);
160160

161-
const wrapper = container.firstChild;
161+
const wrapper = container.firstElementChild;
162162

163163
expect(wrapper).toHaveClass(className);
164164
});
165165

166166
it('applies "--open" className to its wrapper when given isCalendarOpen flag', () => {
167167
const { container } = render(<DateTimePicker isCalendarOpen />);
168168

169-
const wrapper = container.firstChild;
169+
const wrapper = container.firstElementChild;
170170

171171
expect(wrapper).toHaveClass('react-datetime-picker--open');
172172
});
173173

174174
it('applies "--open" className to its wrapper when given isClockOpen flag', () => {
175175
const { container } = render(<DateTimePicker isClockOpen />);
176176

177-
const wrapper = container.firstChild;
177+
const wrapper = container.firstElementChild;
178178

179179
expect(wrapper).toHaveClass('react-datetime-picker--open');
180180
});

0 commit comments

Comments
 (0)