feat(Cypress):Add tests for parts of /settings
page (#39622)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
26
cypress/integration/settings/settings.js
Normal file
26
cypress/integration/settings/settings.js
Normal file
@ -0,0 +1,26 @@
|
||||
/* global cy expect */
|
||||
|
||||
describe('Settings', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/');
|
||||
cy.contains("Get started (it's free)").click({ force: true });
|
||||
cy.visit('/settings');
|
||||
});
|
||||
|
||||
describe('The `Sign me out of freeCodeCamp` button works properly', () => {
|
||||
it('Should get rendered properly', () => {
|
||||
cy.contains('Sign me out of freeCodeCamp')
|
||||
.should('be.visible')
|
||||
// We are checking for classes here to check for proper styling
|
||||
// This will be replaces with Percy in the future
|
||||
.should('have.class', 'btn-invert btn btn-lg btn-primary btn-block');
|
||||
});
|
||||
|
||||
it('Should take to the landing page when clicked', () => {
|
||||
cy.contains('Sign me out of freeCodeCamp').click({ force: true });
|
||||
cy.location().should(loc => {
|
||||
expect(loc.pathname).to.eq('/');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user