From 2d046b63a65be56599226923765bf0ec3d7d1839 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Mon, 8 Nov 2021 21:20:12 +0800 Subject: [PATCH] fix: failed timezone selector UT --- .../components/TimezoneSelector/TimezoneSelector.test.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/superset-frontend/src/components/TimezoneSelector/TimezoneSelector.test.tsx b/superset-frontend/src/components/TimezoneSelector/TimezoneSelector.test.tsx index 7d9d5d714b8f3..bddb9bfc66a1d 100644 --- a/superset-frontend/src/components/TimezoneSelector/TimezoneSelector.test.tsx +++ b/superset-frontend/src/components/TimezoneSelector/TimezoneSelector.test.tsx @@ -54,7 +54,13 @@ describe('TimezoneSelector', () => { }); expect(select).toBeInTheDocument(); userEvent.click(select); - const selection = await screen.findByTitle('GMT -06:00 (America/Belize)'); + + const isDaylight = moment('now').isDST(); + let findTitle = 'GMT -07:00 (Mountain Standard Time)'; + if (isDaylight) { + findTitle = 'GMT -06:00 (Mountain Daylight Time)'; + } + const selection = await screen.findByTitle(findTitle); expect(selection).toBeInTheDocument(); userEvent.click(selection); expect(selection).toBeVisible();