-
-
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 form and slack folders #1775
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-1775--asyncapi-website.netlify.app/ |
…into form_tests
components/slack/Message.js
Outdated
{ reaction.icon ? (<img className="inline-block -mt-0.5 w-4 h-4 object-contain" src={reaction.icon} alt={reaction.name}/>) : (<span className="text-xs mr-1">{reaction.emoji}</span>) } | ||
<span className="inline-block text-blue-500 font-bold ml-1 text-xs">{reaction.count}</span> | ||
<div key={index} className={`inline px-2 py-0.5 mr-1 rounded-xl ${reaction.mine ? 'bg-blue-50 border border-blue-500' : 'bg-gray-100'}`} data-testid="SlackMessage-reaction"> | ||
{ reaction.icon ? (<img className="inline-block -mt-0.5 w-4 h-4 object-contain" src={reaction.icon} alt={reaction.name} data-testid="SlackMessage-img2" />) : (<span className="text-xs mr-1" data-testid="SlackMessage-span">{reaction.emoji}</span>) } |
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.
Don't make the data-testid
in the form of numbers. Make it specific which img it is.
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.
Okay Will do the changes
cypress/test/slack/message.cy.js
Outdated
{ emoji: '👍', count: 5 }, | ||
{ emoji: '❤️', count: 3 }, | ||
// Add more reactions |
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.
Use a sample avatar icon as well from the assets
folder to test the image as well.
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.
Sure , the author images ?
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.
Can you brief a little bit more about this ?
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 have added dummy path for avatar , in assets folder where can I get the image ?
Co-authored-by: Akshat Nema <76521428+akshatnema@users.noreply.github.com>
cypress/test/slack/message.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.
Rename this file to Message.cy.js
.
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
/rtm |
@allcontributors please add @reachaadrika for code |
I've put up a pull request to add @reachaadrika! 🎉 |
Description
**slack == > index.js ** : Included the tests to check if all the message components are rendered successfully .
slack == > message.js : Included the tests to check the reactions , and other related stuff , took a dummy reaction array for this
Related issue(s)
fixes #1774