ashb commented on a change in pull request #15674:
URL: https://github.com/apache/airflow/pull/15674#discussion_r627220644
##########
File path: airflow/ui/src/providers/TimezoneProvider.tsx
##########
@@ -45,9 +45,9 @@ type Props = {
const TimezoneProvider = ({ children }: Props): ReactElement => {
// TODO: add in default_timezone when GET /ui-metadata is available
- // guess timezone on browser or default to utc
- const [timezone, setTimezone] = useState(dayjs.tz.guess() || 'UTC');
-
+ // guess timezone on browser or default to utc and don't guess when testing
+ const isTest = process.env.NODE_ENV === 'test';
+ const [timezone, setTimezone] = useState((!isTest && dayjs.tz.guess()) ||
'UTC');
Review comment:
```suggestion
const [timezone, setTimezone] = useState(isTest ? 'UTC' :
dayjs.tz.guess());
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]