Skip to content

Commit 0021d7d

Browse files
authored
test: add additional expect and check for undefined
1 parent 7069485 commit 0021d7d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/test/calendar_test.test.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,11 +458,19 @@ describe("Calendar", () => {
458458
/>,
459459
);
460460

461+
expect(
462+
container.querySelector(".react-datepicker__navigation--previous"),
463+
).toBe(null);
464+
461465
const secondMonthDate = safeQuerySelectorAll(
462466
container,
463467
".react-datepicker__day--009",
464468
)[1];
465-
fireEvent.click(secondMonthDate!);
469+
if (!secondMonthDate) {
470+
throw new Error("second month date is not found");
471+
}
472+
473+
fireEvent.click(secondMonthDate);
466474

467475
expect(
468476
container.querySelector(".react-datepicker__navigation--previous"),

0 commit comments

Comments
 (0)