Skip to content

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

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

adamstankiewicz
Copy link
Member

For all changes

  • Ensure adequate tests are in place (or reviewed existing tests cover changes)

Only if submitting a visual change

  • Ensure to attach screenshots
  • Ensure to have UX team confirm screenshots

@@ -81,13 +81,10 @@ const AdminOnboardingTours: FC<AdminOnboardingToursProps> = ({
})),
},
];
if (!isOpen) {
Copy link
Member Author

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} />
Copy link
Member Author

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 #.

Comment on lines -10 to -13
jest.mock('@edx/frontend-platform/i18n', () => ({
FormattedMessage: ({ defaultMessage }) => defaultMessage,
defineMessages: (messages) => messages,
}));
Copy link
Member Author

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'];
Copy link
Member Author

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 #.

Base automatically changed from kiram15/ENT-10219 to master June 24, 2025 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants