-
-
Notifications
You must be signed in to change notification settings - Fork 755
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 support-us,Testimonial and JobSummary component #1813
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-1813--asyncapi-website.netlify.app/ |
components/SupportUs.js
Outdated
export const supportItems = [ | ||
{ | ||
href: 'https://slack.com/media-kit', | ||
target: '_blank', | ||
className: 'block relative text-center w-2/3 px-4 py-4 sm:p-0 sm:w-1/3 md:w-1/3 lg:w-1/5', | ||
rel: 'noopener noreferrer', | ||
src: '/img/supportus/slack.webp', | ||
title: 'Slack - Free Standard Subscription.' | ||
}, | ||
{ | ||
href: 'https://toast.ninja/', | ||
target: '_blank', | ||
className: 'block relative text-center w-2/3 px-4 py-4 sm:p-0 sm:w-1/3 md:w-1/3 lg:w-1/5', | ||
rel: 'noopener noreferrer', | ||
src: '/img/supportus/toast.webp', | ||
title: 'Toast - Free services.' | ||
}, | ||
{ | ||
href: 'https://www.netlify.com/', | ||
target: '_blank', | ||
className: 'block relative text-center w-2/3 px-4 py-4 sm:p-0 sm:w-1/3 md:w-1/3 lg:w-1/5', | ||
rel: 'noopener noreferrer', | ||
src: '/img/supportus/netlify.webp', | ||
title: 'Netlify - Free website deployment.' | ||
}, | ||
{ | ||
href: 'https://sonarcloud.io/', | ||
target: '_blank', | ||
className: 'block relative text-center w-2/3 px-4 py-4 sm:p-0 sm:w-1/3 md:w-1/3 lg:w-1/5', | ||
rel: 'noopener noreferrer', | ||
src: '/img/supportus/sonarcloud.webp', | ||
title: 'Sonarcloud - Free tier for automated project scanning.' | ||
}, | ||
{ | ||
href: 'https://www.digitalocean.com/press/', | ||
target: '_blank', | ||
className: 'block relative text-center w-2/3 px-4 py-4 sm:p-0 sm:w-1/3 md:w-1/3 lg:w-1/5', | ||
rel: 'noopener noreferrer', | ||
src: '/img/supportus/digitalocean.webp', | ||
title: 'DigitalOcean - 500 dollars on cloud services.' | ||
}, | ||
{ | ||
href: 'https://restream.io/', | ||
target: '_blank', | ||
className: 'block relative text-center w-2/3 px-4 py-4 sm:p-0 sm:w-1/3 md:w-1/3 lg:w-1/5', | ||
rel: 'noopener noreferrer', | ||
src: '/img/supportus/restream.webp', | ||
title: 'Restream - Free professional plan subscription.' | ||
}, | ||
{ | ||
href: 'https://sessionize.com/', | ||
target: '_blank', | ||
className: 'block relative text-center w-2/3 px-4 py-4 sm:p-0 sm:w-1/3 md:w-1/3 lg:w-1/5', | ||
rel: 'noopener noreferrer', | ||
src: '/img/supportus/sessionize.webp', | ||
title: 'Sessionize - Free community license for AACoT Madrid.' | ||
} | ||
]; | ||
|
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 this static array part of separate file and use it in both components and test files.
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.
done
components/SupportUs.js
Outdated
{ | ||
href: 'https://www.netlify.com/', | ||
target: '_blank', | ||
className: 'block relative text-center w-2/3 px-4 py-4 sm:p-0 sm:w-1/3 md:w-1/3 lg:w-1/5', |
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.
className
should not be the part of this array. Since, these are CSS properties, add the classes in <a>
tag only.
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.
I checked the website <a>
tag had consistent classes , however <div>
and <img>
had different classNames , thus I added classes for img , in the array so that it maps correct classes and thus renders the component as it is .
cypress/test/Testimonial.cy.js
Outdated
text: 'This is a test testimonial.', | ||
authorName: 'John Doe', | ||
authorDescription: 'CEO at Company', | ||
authorAvatar: '/img/avatar.jpg', |
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.
Correct the image path here.
Co-authored-by: Akshat Nema <76521428+akshatnema@users.noreply.github.com>
/rtm |
Description
This PR includes , tests for 3 components : SupportUs, Testimonial and JobSummary components .
SupportUs component , is a list of tools and technologies that AsyncAPI is supported by , earlier this component had a lot of nested tags , and thus I created an array with link tags and all the necessary attributes that are required for the list . This makes the code modular and makes it easier for us to write the test code .
The testcases I have written for this component are as follows :
-Testimonial component , For this component the testcases I have written are as follows :
JobSummary component , For this component the testcases I have written are as follows :
Related issue(s)
fixes #1812