-
-
Notifications
You must be signed in to change notification settings - Fork 773
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 docsCards and feature folders #1763
Conversation
✅ Deploy Preview for asyncapi-website ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-1763--asyncapi-website.netlify.app/ |
Resolve the conflicts before merging @reachaadrika |
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.
Hey @reachaadrika, the tests for DocCards are failing. Kindly take the updated data.
cypress/test/docs/DocsCards.cy.js
Outdated
const cards = [ | ||
{ | ||
title: 'Concepts', | ||
description: 'Our Concepts section defines the concepts of AsyncAPI features and capabilities.', | ||
link: '/docs/concepts', | ||
className: 'bg-secondary-200', | ||
Icon: IconGettingStarted, | ||
}, | ||
{ | ||
title: 'Tutorials', | ||
description: 'Our Tutorials section teaches beginner processes with AsyncAPI, guiding you from Point A to Point B.', | ||
link: '/docs/tutorials', | ||
className: 'bg-pink-100', | ||
Icon: IconTutorials, | ||
}, | ||
{ | ||
title: 'Tools', | ||
description: 'Our Tools section documents the AsyncAPI tools ecosystem.', | ||
link: '/docs/tools', | ||
className: 'bg-green-200', | ||
Icon: IconUseCases, | ||
}, | ||
{ | ||
title: 'Guides', | ||
description: "Our Guides section teaches AsyncAPI's capabilities at a high level.", | ||
link: '/docs/guides', | ||
className: 'bg-primary-200', | ||
Icon: IconGuide, | ||
}, | ||
{ | ||
title: 'Reference', | ||
description: 'Our Reference section documents the AsyncAPI specification.', | ||
link: '/docs/reference', | ||
className: 'bg-yellow-200', | ||
Icon: IconSpec, | ||
} | ||
]; |
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.
Please use data buckets here as we use it in DocCards.js. This will maintain consistency among the codebase and we need not to update the things at 2 places.
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.
cypress/test/features/index.cy.js
Outdated
const features = [ | ||
{ | ||
name: "Specification", | ||
description: | ||
"Allows you to define the interfaces of asynchronous APIs and is protocol agnostic.", | ||
links: [{ label: "Documentation", href: "docs/specifications/latest", id:'whyasyncapi-spec-documentation-link' }], | ||
}, | ||
{ | ||
name: "Document APIs", | ||
description: | ||
"Use our tools to generate documentation at the build level, on a server, and on a client.", | ||
links: [ | ||
{ | ||
label: "HTML Template", | ||
href: "https://github.com/asyncapi/html-template", | ||
id:'whyasyncapi-apis-htmltemplate-link' | ||
}, | ||
{ | ||
label: "React Component", | ||
href: "https://github.com/asyncapi/asyncapi-react/", | ||
id:'whyasyncapi-apis-reactcomponents-link' | ||
}, | ||
], | ||
}, | ||
{ | ||
name: "Code Generation", | ||
description: | ||
"Generate documentation, Code (TypeScript, Java, C#, etc), and more out of your AsyncAPI files.", | ||
links: [{ label: "Generator", href: "tools/generator", id:'whyasyncapi-generation-generator-link' }, { label: "Modelina", href: "tools/modelina", id:'whyasyncapi-generation-modelina-link' }], | ||
}, | ||
{ | ||
name: "Community", | ||
description: "We're a community of great people who are passionate about AsyncAPI and event-driven architectures.", | ||
links: [ | ||
{ label: "Join our Slack", href: "https://asyncapi.com/slack-invite", id:'whyasyncapi-community-slack-link' }, | ||
], | ||
}, | ||
{ | ||
name: "Open Governance", | ||
description: | ||
"Our Open-Source project is part of Linux Foundation and works under an Open Governance model.", | ||
links: [{ label: "Read more about Open Governance", href: "blog/governance-motivation", id:'whyasyncapi-governance-more-link' }, { label: "TSC Members", href: "community/tsc", id:'whyasyncapi-governance-tsc-link' }], | ||
}, | ||
{ | ||
name: "And much more...", | ||
description: | ||
"We have many different tools and welcome you to explore our ideas and propose new ideas to AsyncAPI.", | ||
links: [{ label: "View GitHub Discussions", href: "https://github.com/asyncapi/community/discussions", id:'whyasyncapi-muchmore-github-link' }], | ||
}, | ||
]; |
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.
Here you require slight refactoring inside the codebase. Even inside the features/index.jsx
, kindly export this array into separate file in same folder and use this array in both code and test file to maintain consistency.
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 , created a different file and exported the features list
… DocsCards_test
Co-authored-by: Akshat Nema <76521428+akshatnema@users.noreply.github.com>
/rtm |
Description
This pull request includes tests for 2 components of website docs (DocsCards.js ) and features ( index.jsx ) .
-renders all features with their names, descriptions, and links
(NOTE : This is a single test , with all the required assertions )
The assertions included in this are :
Related issue(s)
fixes #1762