-
-
Notifications
You must be signed in to change notification settings - Fork 765
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
feat: adding unit tests for sponsors component #1804
Conversation
✅ Deploy Preview for asyncapi-website ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-1804--asyncapi-website.netlify.app/ |
cypress/test/sponsors/sponsors.cy.js
Outdated
@@ -0,0 +1,37 @@ | |||
import { mount } from 'cypress/react'; |
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.
Make the filename as Sponsors.cy.js
.
/rtm |
Description
All these were standalone files in the codebase , for ease of navigation and additional refactoring , I added these files into a single folder and updated the imports , so that this is not a breaking change .
Along with this for writing unit tests , the code required some additional refactoring , earlier each sponsor was added separately in an li tag with image associated with , I instead of following this approach created an array of sponsors with all necessary classes and fetched and mapped the data through it . So that we need to change the data and testcases , if a new sponsor is added to the list in future . We could update the array , and it would reflect both in application code as well as the test file .
For this I created 3 files : SponsorsList.js , GoldSponsorsList.js and SilverSponsorsList.js .
Further following are the tests and test files for each of the Sponsors file :
Here I included the following test cases :
GoldSponsors.js**
Here are the tests that I included :
-renders the gold sponsors
SilverSponsors.js
NOTE : Along with unit tests this PR includes additional code refactoring
Related issue(s)
fixes #1803