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

feat: adding unit tests for support-us,Testimonial and JobSummary component #1813

Merged
merged 22 commits into from
Jul 11, 2023

Conversation

reachaadrika
Copy link
Contributor

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 :

  1. should render support items with correct attributes
    image

-Testimonial component , For this component the testcases I have written are as follows :

  1. should render the testimonial with correct data
    image

JobSummary component , For this component the testcases I have written are as follows :

  1. renders job summary with correct information
    image

Related issue(s)
fixes #1812

@netlify
Copy link

netlify bot commented Jun 20, 2023

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit dd5a92a
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/64ad27c5c2fa080008b3fa84
😎 Deploy Preview https://deploy-preview-1813--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions
Copy link

github-actions bot commented Jun 20, 2023

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 43
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🔴 PWA 30

Lighthouse ran on https://deploy-preview-1813--asyncapi-website.netlify.app/

@akshatnema akshatnema added the gsoc This label should be used for issues or discussions related to ideas for Google Summer of Code label Jun 27, 2023
Comment on lines 3 to 61
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.'
}
];

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

{
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',
Copy link
Member

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.

Copy link
Contributor Author

@reachaadrika reachaadrika Jul 9, 2023

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 .

text: 'This is a test testimonial.',
authorName: 'John Doe',
authorDescription: 'CEO at Company',
authorAvatar: '/img/avatar.jpg',
Copy link
Member

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.

@reachaadrika
Copy link
Contributor Author

/rtm

@asyncapi-bot asyncapi-bot merged commit 53e7517 into asyncapi:master Jul 11, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gsoc This label should be used for issues or discussions related to ideas for Google Summer of Code ready-to-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add tests for SupportUs, Testimonial and JobSummary
3 participants