-
-
Notifications
You must be signed in to change notification settings - Fork 632
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: add integration tests for dashboard component & community pages #1953
feat: add integration tests for dashboard component & community pages #1953
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-1953--asyncapi-website.netlify.app/ |
… dashboard_integration_tests
…haadrika/website into dashboard_integration_tests
cypress/test/dashboard/Header.cy.js
Outdated
cy.contains('View on Github') | ||
cy.contains('Join on Slack') |
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 did we change these tests?
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
it('should display NewsletterSubscribe',()=>{ | ||
cy.get('[data-testid="CommunityCard-subscribe"]').should('exist'); | ||
cy.get('[data-testid="NewsletterSubscribe-main"]').should('exist'); | ||
cy.get('[data-testid="NewsletterSubscribe-text-input"]').type("name"); | ||
cy.get('[data-testid="NewsletterSubscribe-email-input"]').type("[email protected]") | ||
cy.get('form[name="form 1"]').should('exist'); | ||
cy.get('input[name="type"]').should('exist'); | ||
cy.get('input[name="name"]').should('exist'); | ||
cy.get('input[name="email"]').should('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.
This test shouldn't be repeated for every file. Instead, make integration test for this component in NewsletterSubscribe
test file. Also, mock the API response for this form.
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
…haadrika/website into dashboard_integration_tests
cy.get('[ data-testid="Meeting-host"]').should('exist') | ||
cy.get('[ data-testid="Meeting-link"]').should('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 integration tests for events filter in this 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
cy.contains('Tokens of our appreciation').should('exist'); | ||
|
||
cy.contains('We appreciate your commitment and passion for sharing your knowledge with your communities. Let us support you!') | ||
.should('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.
Instead of checking for the content, check for the respective tags, whether they are present. We are not concerned about testing the content inside the tag, we are testing whether the heading and relative content to it is present or not.
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
cy.contains('Become an AsyncAPI Ambassador').should('exist'); | ||
|
||
cy.contains('The AsyncAPI Ambassador program is now open for applications! If you’re selected, you’ll join AsyncAPI\'s mission of helping community members all over the world, build the future of Event-Driven APIs.') | ||
.should('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.
Don't check for content, check for the tags using data-testid.
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
cy.get('[data-testid="Github-button"]').should('exist'); | ||
cy.get('[data-testid="Slack-button"]').should('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.
These lines shouldn't be removed. We should also check for buttons using data-testid also, apart from checking it via text.
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
@@ -0,0 +1,27 @@ | |||
import AppContext from "../../context/AppContext"; |
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.
Specify why MockApp
has been created using comments.
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 <[email protected]>
…haadrika/website into dashboard_integration_tests
}); | ||
|
||
it('check for Events Filters' , () => { | ||
cy.get('[data-testid="EventFilters-main"]').should('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.
Kindly apply the Event filters and check whether correct events are shown or not.
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 |
Description
Dashboard , component mainly has following components :
The flow of test for this , is that dashboard component has GoodFirstIssues component , which displays goodFirstIssues , but also Filters them according to repository and areas , and displays the filtered data in the component . It uses the Filters Component , which within itself uses Select Component . Thus the test for this involved as follows :
Finally I checked if the hotTopics , is displayed correctly in the Table component .
-The data that has been utilized here is dashboard.json
NOTE : This PR also includes some fixes associated with the unit tests written for dashboard component .
Related issue(s)
fixes #1952