-
Notifications
You must be signed in to change notification settings - Fork 33
fix: clean up to get passing test #1550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@@ -81,13 +81,10 @@ const AdminOnboardingTours: FC<AdminOnboardingToursProps> = ({ | |||
})), | |||
}, | |||
]; | |||
if (!isOpen) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[inform] It's OK to render the ProductTour
component itself because each tour itself has the enabled: boolean
flag, which is also set to isOpen
. Then, CheckpointOverlay
appears to return null
as well if there's no rect
, so rendering both CheckpointOverlay
and ProductTour
here irrespective of isOpen
should be a no-op.
|
||
return ( | ||
<> | ||
<CheckpointOverlay target={`#${targetSelector}`} /> | ||
<CheckpointOverlay target={targetSelector} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[inform] Ensuring we always include #
when defining selectors, since the selector is intended to semantically include the #
.
jest.mock('@edx/frontend-platform/i18n', () => ({ | ||
FormattedMessage: ({ defaultMessage }) => defaultMessage, | ||
defineMessages: (messages) => messages, | ||
})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[inform] Unnecessary to mock.
const mockOnAdvance = jest.fn(); | ||
|
||
const targets = ['#step-1', '#step-2', '#step-3', '#step-4']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[inform] the list of targets
is never iterated over, and so we can simply use the explicit selectors where needed without needing to do any transforming to replace the #
.
For all changes
Only if submitting a visual change