Files
freeCodeCamp/cypress/e2e/default/settings/certifications.ts
Sam Rice 8c03f0910c refactor(cypress): convert additional specs to ts (#49143)
* convert challenge-hot-keys to ts

* rename selector object in challenge-hot-keys

* convert challenges/output to ts

* update selector and location objects in challenges/output

* convert common-components/searchBar to ts

* add missing type and fix final url assertion

* convert searchBar to kebab-case and fix URL assertion

* convert donate-page-donor to ts

* convert donation-block-completion-modal to ts

* resolve compilation errors in donation-block-completion-modal.ts

* convert intro-page to ts

* resolve compiler errors in intro-page.ts

* convert settings/certifications to ts

* add cypress testing library types to tsconfig for settings/certifications.ts

* convert settings/image-picture-check to ts

* convert settings/settings to ts

* convert settings/user-token to ts

* convert settings/username-change to ts

* resolve compiler errors in settings/username-change.ts

* convert default/top-contributor to ts

* add ES2017 to compilerOptions.lib in cypress/tsconfig

* edit custom command interface
2023-01-26 20:25:19 +00:00

41 lines
1.2 KiB
TypeScript

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'
);
});
});
});