From a541111f883bc6c40918680763981d313dced92f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=AA=20Nh=C3=A2n=20Ph=E1=BB=A5ng?= Date: Fri, 5 Dec 2025 16:28:03 +0700 Subject: [PATCH] test: add delay wait for TimePicker handler in test case - Add 150ms delay wait after time input change to ensure handler completes - Fixes test case that was failing due to 0.1s delay in handleStartTimeChangeWithClose --- __test__/components/EventModifications.test.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/__test__/components/EventModifications.test.tsx b/__test__/components/EventModifications.test.tsx index 69d13ac..2ea714f 100644 --- a/__test__/components/EventModifications.test.tsx +++ b/__test__/components/EventModifications.test.tsx @@ -408,6 +408,11 @@ describe("CalendarApp integration", () => { }); }); + // Wait for the 0.1s delay in handleStartTimeChangeWithClose to complete + await act(async () => { + await new Promise((resolve) => setTimeout(resolve, 150)); + }); + const saveButton = screen.getByRole("button", { name: /save/i }); await act(async () => { saveButton.click();