Files
freeCodeCamp/cypress/integration/default/settings/certifications.js
Ahmad Abdolsaheb 29e4a18a56 feat(tools): donation tests (#46633)
* feat: add stripe donate page test for non donors

* fix: revert changes to see if ev is passed correctly

* feat: download artifacts

* fix: add quotations for spec args with global patterns

* fix: remove firefox from cypress donation tests

* fix: trigger action on main push

* Apply suggestions from code review

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* feat: remove matrix and simplify

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2022-08-08 08:43:23 -07:00

41 lines
1.2 KiB
JavaScript

import '@testing-library/cypress/add-commands';
describe('Settings certifications area', () => {
describe('initially', () => {
before(() => {
cy.exec('npm run seed');
cy.login();
});
it('Should render the default settings page', () => {
cy.visit('/settings/');
cy.findAllByText('Claim Certification').should($btns => {
expect($btns).to.have.length(16);
});
cy.findByText('Show Certification').should('not.exist');
cy.contains('Agree');
cy.contains('Claim Certification').click();
cy.contains(
'To claim a certification, you must first accept our academic honesty policy'
);
});
});
describe('after isHonest', () => {
before(() => {
cy.exec('npm run seed');
cy.login();
});
it('Should update the user as they try to claim their certifications', () => {
cy.visit('/settings');
cy.contains('Agree').click();
cy.contains('You have accepted our Academic Honesty Policy.');
cy.contains('Claim Certification').click();
cy.contains(
'It looks like you have not completed the necessary steps. Please complete the required projects to claim the Responsive Web Design Certification'
);
});
});
});