Skip to content
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

(test) O3-3610 : Unit test for rendering tutorials #8

Merged
merged 2 commits into from
Aug 5, 2024

Conversation

Vijaykv5
Copy link
Contributor

@Vijaykv5 Vijaykv5 commented Jul 16, 2024

Requirements

  • This PR has a title that briefly describes the work done including a conventional commit type prefix and a Jira ticket number if applicable. See existing PR titles for inspiration.

For changes to apps

If applicable

  • My work includes tests or is validated by existing tests.

Summary

Added test for rendering tutorials.

Screenshots

Related Issue

Other

O3-3610

@Vijaykv5 Vijaykv5 marked this pull request as draft July 16, 2024 08:50
Comment on lines 77 to 81
if (element) {
console.log('Found element:', element);
} else {
console.log('Element not found for:', step.content);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to use console logs here. You can use an assertion.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 71 to 74
const walkthroughButton = screen.getByText('Basic Tutorial').closest('.tutorialItem').querySelector('.walkthrough');
await user.click(walkthroughButton);

await waitFor(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What this test should do is it should check if it lists down all the tutorials. No need to click them nor to go through the steps.

Should be something like:

for all tutorial in tutorials:
    expect the tutorial title and description is loaded properly

@Vijaykv5 Vijaykv5 marked this pull request as ready for review August 5, 2024 04:44
Copy link
Member

@jayasanka-sack jayasanka-sack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Vijaykv5 !

@jayasanka-sack jayasanka-sack merged commit 711ed30 into openmrs:main Aug 5, 2024
5 checks passed
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