-
-
Notifications
You must be signed in to change notification settings - Fork 35.9k
/
certifications.ts
40 lines (36 loc) · 1.31 KB
/
certifications.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import '@testing-library/cypress/add-commands';
describe('Settings certifications area', () => {
describe('initially', () => {
before(() => {
cy.task('seed');
cy.login();
});
it('Should render the default settings page', () => {
cy.visit('/settings');
cy.findAllByText('Claim Certification').should($btns => {
expect($btns).to.have.length(19);
});
cy.findByText('Show Certification').should('not.exist');
cy.contains(`I agree to freeCodeCamp's Academic Honesty Policy.`);
cy.contains('Claim Certification').click();
cy.contains(
'To claim a certification, you must first agree to our academic honesty policy'
);
});
});
describe('after isHonest', () => {
before(() => {
cy.task('seed');
cy.login();
});
it('Should update the user as they try to claim their certifications', () => {
cy.visit('/settings');
cy.contains(`I agree to freeCodeCamp's Academic Honesty Policy.`).click();
cy.contains('You have agreed to 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'
);
});
});
});