fix(learn): add e2e tests for navigation buttons in /learn (#39455)

This commit is contained in:
Twaha Rahman 2020-08-24 16:47:33 +06:00 committed by GitHub
parent cf2a8010b1
commit 16a643d66f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,23 @@
/* global cy */
describe('The `Update my account settings` button works properly', function() {
beforeEach(() => {
cy.visit('/');
cy.contains("Get started (it's free)").click({ force: true });
});
it('Should get rendered', function() {
cy.contains('View my Portfolio').should(
'have.class',
'btn btn-lg btn-primary btn-block'
);
cy.contains('View my Portfolio').should('be.visible');
});
it('Should take user to their account settings when clicked', function() {
cy.contains('Update my account settings').click({ force: true });
cy.url().should('include', '/settings');
});
});

View File

@ -0,0 +1,23 @@
/* global cy */
describe('The `View my Portfolio` button works properly', function() {
beforeEach(() => {
cy.visit('/');
cy.contains("Get started (it's free)").click({ force: true });
});
it('Button gets rendered', function() {
cy.contains('View my Portfolio').should(
'have.class',
'btn btn-lg btn-primary btn-block'
);
cy.contains('View my Portfolio').should('be.visible');
});
it('Button takes user to their portfolio when clicked', function() {
cy.contains('View my Portfolio').click({ force: true });
cy.url().should('include', '/developmentuser');
});
});