diff --git a/generators/cypress/templates/src/test/javascript/cypress/integration/account/login-page_spec.ts.ejs b/generators/cypress/templates/src/test/javascript/cypress/integration/account/login-page_spec.ts.ejs index 4578e0b83c5..318f70b7f6a 100644 --- a/generators/cypress/templates/src/test/javascript/cypress/integration/account/login-page_spec.ts.ejs +++ b/generators/cypress/templates/src/test/javascript/cypress/integration/account/login-page_spec.ts.ejs @@ -17,7 +17,7 @@ describe('login modal', () => { beforeEach(() => { cy.server(); - cy.route('POST', '/api/authentication').as('authentication'); + cy.route('POST', '/api/<%_ if (authenticationType === 'session') { _%>authentication<% } else { %>authenticate<% } %>').as('authenticate'); }); it('greets with signin', () => { @@ -27,7 +27,7 @@ describe('login modal', () => { it('requires username', () => { cy.get(passwordLoginSelector).type('a-password'); cy.get(submitLoginSelector).click(); - cy.wait('@authentication').its('status').should('equal', 403); + cy.wait('@authenticate').its('status').should('equal', 400); // login page should stay open when login fails cy.get(titleLoginSelector).should('be.visible'); cy.get(passwordLoginSelector).clear(); @@ -36,7 +36,7 @@ describe('login modal', () => { it('requires password', () => { cy.get(usernameLoginSelector).type('a-login'); cy.get(submitLoginSelector).click(); - cy.wait('@authentication').its('status').should('equal', 403); + cy.wait('@authenticate').its('status').should('equal', 400); cy.get(errorLoginSelector).should('be.visible'); cy.get(usernameLoginSelector).clear(); }); @@ -45,7 +45,7 @@ describe('login modal', () => { cy.get(usernameLoginSelector).type('admin'); cy.get(passwordLoginSelector).type('bad-password'); cy.get(submitLoginSelector).click(); - cy.wait('@authentication').its('status').should('equal', 403); + cy.wait('@authenticate').its('status').should('equal', 401); cy.get(errorLoginSelector).should('be.visible'); cy.get(usernameLoginSelector).clear(); cy.get(passwordLoginSelector).clear(); @@ -55,8 +55,7 @@ describe('login modal', () => { cy.get(usernameLoginSelector).type('admin'); cy.get(passwordLoginSelector).type('admin'); cy.get(submitLoginSelector).click(); - cy.wait('@authentication').its('status').should('equal', 200); + cy.wait('@authenticate').its('status').should('equal', 200); cy.hash().should('eq', ''); - cy.wait('@getAccount').its('status').should('equal', 200); }); });