diff --git a/airflow/ui/src/components/Time.test.tsx b/airflow/ui/src/components/Time.test.tsx index 9e59d96dd471..2b6b26d6a2f2 100644 --- a/airflow/ui/src/components/Time.test.tsx +++ b/airflow/ui/src/components/Time.test.tsx @@ -54,11 +54,12 @@ describe("Test Time and TimezoneProvider", () => { }, ); - const samoaTime = screen.getByText(dayjs(now).tz(tz).format(defaultFormat)); + const nowTime = dayjs(now); + const samoaTime = screen.getByText(nowTime.tz(tz).format(defaultFormat)); expect(samoaTime).toBeDefined(); expect(samoaTime.title).toEqual( - dayjs().tz("UTC").format(defaultFormatWithTZ), + nowTime.tz("UTC").format(defaultFormatWithTZ), ); }); });