mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-02-24 02:01:30 -05:00
Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com> Co-authored-by: Sem Bauke <semboot699@gmail.com>
43 lines
1.5 KiB
TypeScript
43 lines
1.5 KiB
TypeScript
describe('Public profile certifications', () => {
|
|
context('Signed in user viewing their own public profile', () => {
|
|
before(() => {
|
|
cy.task('seed', ['certified-user']);
|
|
});
|
|
|
|
beforeEach(() => {
|
|
cy.login('certified-user');
|
|
});
|
|
|
|
it('Should show claimed certifications if the username has all lowercase characters', () => {
|
|
cy.visit('/certifieduser', { failOnStatusCode: false });
|
|
|
|
// The following line is only required if you want to test it in development
|
|
//cy.contains('Preview custom 404 page').click();
|
|
|
|
cy.get('[data-cy=claimed-certification]').should('have.length', 19);
|
|
});
|
|
|
|
it('Should show claimed certifications if the username includes uppercase characters', () => {
|
|
// Modify username to include uppercase characters
|
|
cy.goToSettings();
|
|
cy.typeUsername('CertifiedUser');
|
|
cy.contains('Username is available');
|
|
cy.get('@usernameForm').contains('Save').click();
|
|
cy.contains('We have updated your username to CertifiedUser').should(
|
|
'be.visible'
|
|
);
|
|
|
|
cy.visit('/certifieduser', { failOnStatusCode: false });
|
|
|
|
// The following line is only required if you want to test it in development
|
|
//cy.contains('Preview custom 404 page').click();
|
|
|
|
cy.get('[data-cy=claimed-certification]').should('have.length', 19);
|
|
});
|
|
});
|
|
|
|
// To do: Add another context to test for cases where a logged out user views
|
|
// a profile where the username has all lowercase chars, and some uppercase chars
|
|
// when that's fixed
|
|
});
|