Skip to content

Commit

Permalink
Add landing test wrong email
Browse files Browse the repository at this point in the history
  • Loading branch information
wg102 committed Apr 10, 2024
1 parent 3d08f1f commit 52f72bc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions components/centraldashboard/cypress/e2e/landing-page.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,23 @@ describe('Landing Page', () => {
cy.get('main-page').shadow().find('landing-page').shadow().find('#MainCard > neon-animatable').find('md2-input#Email').should('exist').and('have.prop', 'value', '[email protected]');
cy.get('main-page').shadow().find('landing-page').shadow().find('#MainCard > neon-animatable').find('md2-input#Namespace').should('exist').and('have.prop', 'value', 'user-name');
});

// Ig the email is cloud statcan (or any not statcan.gc.ca) expect to see error with logout
it('should show wrong email page', ()=>{
cy.intercept('GET', `/api/workgroup/exists`, {
"hasAuth":true,
"user":"[email protected]",
"email": "[email protected]",
"hasWorkgroup":false,
"registrationFlowAllowed":true
}).as('mockWorkgroupRequest');
cy.visit('/');

cy.wait(['@mockWorkgroupRequest', '@mockDashboardLinksRequest']);

cy.get('main-page').shadow().find('landing-page').should('exist');
cy.get('main-page').shadow().find('landing-page').shadow().find('#MainCard > neon-animatable > h2').should('have.text', 'Welcome');
cy.get('main-page').shadow().find('landing-page').shadow().find('#MainCard > neon-animatable > p').should('have.text', 'You are currently logged in using [email protected], this domain is not supported. Please log out and log in using your “@statcan.gc.ca” email.');
cy.get('main-page').shadow().find('landing-page').shadow().find('#MainCard > neon-animatable > paper-button').should('have.text', 'Logout');
})
});

0 comments on commit 52f72bc

Please sign in to comment.