From 017183dd9b58cf75b9b933c905d3dc1ae3f03200 Mon Sep 17 00:00:00 2001 From: Henrik Kubitza Date: Thu, 19 Sep 2024 16:25:56 +0200 Subject: [PATCH] test: shows custom time caption --- src/test/timepicker_test.test.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/test/timepicker_test.test.tsx b/src/test/timepicker_test.test.tsx index 7fd0e8fa8..3ed6d043e 100644 --- a/src/test/timepicker_test.test.tsx +++ b/src/test/timepicker_test.test.tsx @@ -316,6 +316,24 @@ describe("TimePicker", () => { expect(onKeyDownSpy).toHaveBeenCalledTimes(1); }); + it("shows custom time caption text", () => { + const { container } = render( + , + ); + + 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(