msyavuz commented on code in PR #31310:
URL: https://github.com/apache/superset/pull/31310#discussion_r1891792689
##########
superset-frontend/src/components/TimezoneSelector/TimezoneSelector.test.tsx:
##########
@@ -46,20 +41,20 @@ const openSelectMenu = () => {
userEvent.click(searchInput);
};
-jest.spyOn(moment.tz, 'guess').mockReturnValue('America/New_York');
+jest.spyOn(extendedDayjs.tz, 'guess').mockReturnValue('America/New_York');
afterEach(() => {
jest.useRealTimers();
});
-test('use the timezone from `moment` if no timezone provided', async () => {
+test('use the timezone from `dayjs` if no timezone provided', async () => {
const TimezoneSelector = await loadComponent('2022-01-01');
const onTimezoneChange = jest.fn();
render(<TimezoneSelector onTimezoneChange={onTimezoneChange} />);
- expect(screen.getByLabelText('Loading')).toBeVisible();
- await waitForElementToBeRemoved(() => screen.queryByLabelText('Loading'));
+ // expect(screen.getByLabelText('Loading')).toBeVisible();
+ // await waitForElementToBeRemoved(() => screen.queryByLabelText('Loading'));
Review Comment:
~~There seems to be a regression on the lazy loading. I will reuse these
when i fix that.~~
I thought there was a regression but the slowness doesn't seem to come from
it, using a map to lookup fixed it.
This component used to lazy load Moment and when in the process of loading
displayed the Loading component. There is no need to do that now, removed the
Loading component as well
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]