Skip to content

Commit

Permalink
test: shows custom time caption
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrik Kubitza committed Sep 19, 2024
1 parent 2771fe4 commit 017183d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/test/timepicker_test.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,24 @@ describe("TimePicker", () => {
expect(onKeyDownSpy).toHaveBeenCalledTimes(1);
});

it("shows custom time caption text", () => {
const { container } = render(
<DatePicker
open
showTimeSelect
showTimeSelectOnly
timeCaption="Custom time"
/>,
);

const header = container.querySelector(
".react-datepicker__header--time--only",
);

expect(header).not.toBeNull();
expect(header?.textContent).toEqual("Custom time");
});

it("hides time caption", () => {
const { container } = render(
<DatePicker
Expand Down

0 comments on commit 017183d

Please sign in to comment.