feat: add donation options to donors alert and donation page footer (#40498)
* feat: add donation options to donors alert and donation page footer * Update client/src/components/Donation/DonationOptionsText.js Co-authored-by: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com> * Update client/src/components/Donation/DonationOptionsText.js Co-authored-by: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com> * fix: clean up * fix: remove comments * feat: make the component declerative * feat: move donation text components to one component * feat: add cypress tests for donate page * Update cypress/integration/learn/donate/donate-page-default.js Co-authored-by: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com> Co-authored-by: Kris Koishigawa <scissorsneedfoodtoo@gmail.com> Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
This commit is contained in:
45
cypress/integration/learn/donate/donate-page-donor.js
Normal file
45
cypress/integration/learn/donate/donate-page-donor.js
Normal file
@ -0,0 +1,45 @@
|
||||
/* global cy */
|
||||
|
||||
const selectors = {
|
||||
donateAlert: {
|
||||
firstText: '.alert-info p:first-child',
|
||||
secondText: '.alert-info p:last-child',
|
||||
link: '.alert-info a'
|
||||
}
|
||||
};
|
||||
|
||||
describe('Donate page', () => {
|
||||
before(() => {
|
||||
cy.clearCookies();
|
||||
cy.exec('npm run seed -- --donor');
|
||||
cy.login();
|
||||
cy.visit('/donate');
|
||||
});
|
||||
|
||||
after(() => {
|
||||
cy.exec('npm run seed');
|
||||
});
|
||||
|
||||
it('Donor alert should be visible for donor', () => {
|
||||
cy.get('.alert-info').should('be.visible');
|
||||
});
|
||||
|
||||
it('Donor should see alert message', () => {
|
||||
cy.contains(
|
||||
selectors.donateAlert.firstText,
|
||||
'Thank you for being a supporter of freeCodeCamp. You currently have a recurring donation.'
|
||||
);
|
||||
cy.contains(
|
||||
selectors.donateAlert.lastText,
|
||||
"Want to make a bigger one-time donation, mail us a check, or give in other ways? Here are many other ways we could support our non-profit's mission."
|
||||
);
|
||||
});
|
||||
|
||||
it('Donor alert section should have donation link', () => {
|
||||
cy.get(selectors.donateAlert.link).should(
|
||||
'have.attr',
|
||||
'href',
|
||||
'https://www.freecodecamp.org/news/how-to-donate-to-free-code-camp'
|
||||
);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user