Skip to content

Commit ec836b3

Browse files
Fix custom time input test target
1 parent da71c2f commit ec836b3

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/test/input_time.test.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,19 @@ describe("InputTime", () => {
209209
<InputTime
210210
date={date}
211211
timeString="10:00"
212-
customTimeInput={<CustomTimeInput onTimeChange={onTimeChange} />}
212+
customTimeInput={
213+
<CustomTimeInput
214+
data-testid="custom-time-input"
215+
onTimeChange={onTimeChange}
216+
/>
217+
}
213218
/>,
214219
);
215220

216-
const timeInput = container.querySelector(
217-
'input[type="time"]',
221+
const customInput = container.querySelector(
222+
'[data-testid="custom-time-input"]',
218223
) as HTMLInputElement;
219-
fireEvent.change(timeInput, { target: { value: "11:15" } });
224+
fireEvent.change(customInput, { target: { value: "11:15" } });
220225

221226
expect(onTimeChange).toHaveBeenCalledWith(date);
222227
});

0 commit comments

Comments
 (0)