You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/03/15 01:55:32 UTC

[GitHub] [superset] ktmud commented on a change in pull request #19148: fix: TimezoneSelector is not reliably testable

ktmud commented on a change in pull request #19148:
URL: https://github.com/apache/superset/pull/19148#discussion_r826514576



##########
File path: superset-frontend/src/components/TimezoneSelector/TimezoneSelector.test.tsx
##########
@@ -27,91 +27,104 @@ jest.spyOn(moment.tz, 'guess').mockReturnValue('America/New_York');
 const getSelectOptions = () =>
   waitFor(() => document.querySelectorAll('.ant-select-item-option-content'));
 
-it('use the timezone from `moment` if no timezone provided', () => {
-  const onTimezoneChange = jest.fn();
-  render(<TimezoneSelector onTimezoneChange={onTimezoneChange} />);
-  expect(onTimezoneChange).toHaveBeenCalledTimes(1);
-  expect(onTimezoneChange).toHaveBeenCalledWith('America/Nassau');
-});
+describe('TimezoneSelector', () => {

Review comment:
       I thought we have agreed on not adding `describe`?  https://github.com/apache/superset/wiki/Testing-Guidelines-and-Best-Practices#avoid-nesting-when-youre-testing




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org