-
-
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 button component #1818
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-1818--asyncapi-website.netlify.app/ |
); | ||
cy.contains('Custom Text').should('be.visible'); | ||
cy.get('[ data-testid="Button-link"]').should('have.attr', 'href', customHref); | ||
cy.get('[ data-testid="Button-link"]').should('have.attr', 'target', '_self'); |
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.
why are you adding space here? between [ data-test
@reachaadrika
Please install a formatter extension in your vscode
fix this space issue with all over 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.
fixed
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.
minor space related issue, fix this and we can merge then
It has button testcases only |
<GoogleCalendarButton | ||
text="Custom Text" | ||
href={customHref} | ||
target="_self" | ||
iconPosition="right" | ||
/> |
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.
You have mounted wrong component inside ICSFileButton.cy.js
test file.
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
cypress/test/buttons/buttons.cy.js
Outdated
@@ -0,0 +1,48 @@ | |||
import React from '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 Button.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
cypress/test/buttons/buttons.cy.js
Outdated
cy.get('[data-testid="Button-main"]').should('have.attr', 'type', type); | ||
cy.get('[data-testid="Button-link"]').should('not.exist'); | ||
}); | ||
|
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.
Add a case for testing if icon is not present in Button component.
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
Co-authored-by: Akshat Nema <76521428+akshatnema@users.noreply.github.com>
Co-authored-by: Akshat Nema <76521428+akshatnema@users.noreply.github.com>
Co-authored-by: Akshat Nema <76521428+akshatnema@users.noreply.github.com>
/rtm |
Description
For the Main Button component I have included following tests :
Other Button files here are as follows :
For these components the tests that I have included are as follows :
Related issue(s)
fixes #1730