Skip to content

Commit

Permalink
When a user has no roles, logout on button click (#830)
Browse files Browse the repository at this point in the history
* adding test to check when a user has no roles, clicking button will log them out

Signed-off-by: leanneeliatra <[email protected]>
Signed-off-by: [email protected] <[email protected]>

* Remove unneeded code & depreciated server()

Signed-off-by: leanneeliatra <[email protected]>
Signed-off-by: [email protected] <[email protected]>

* remove extra comments

Signed-off-by: leanneeliatra <[email protected]>
Signed-off-by: [email protected] <[email protected]>

* removed whitespace

Signed-off-by: [email protected] <[email protected]>

* Update missing_role_button_logout.js

updating as per updates & request

Signed-off-by: leanneeliatra <[email protected]>

* Update cypress/integration/plugins/security-dashboards-plugin/missing_role_button_logout.js

Co-authored-by: Yulong Ruan <[email protected]>
Signed-off-by: leanneeliatra <[email protected]>

* Update missing_role_button_logout.js

Signed-off-by: leanneeliatra <[email protected]>

* Update missing_role_button_logout.js

Signed-off-by: leanneeliatra <[email protected]>

* Update missing_role_button_logout.js

Signed-off-by: leanneeliatra <[email protected]>

---------

Signed-off-by: leanneeliatra <[email protected]>
Signed-off-by: [email protected] <[email protected]>
Signed-off-by: leanneeliatra <[email protected]>
Co-authored-by: Yulong Ruan <[email protected]>
(cherry picked from commit ab57fb3)
  • Loading branch information
leanneeliatra authored and github-actions[bot] committed Oct 24, 2023
1 parent 518ce68 commit 78b5e1e
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
if (Cypress.env('SECURITY_ENABLED')) {
it('Tests if no role button redirects to logout screen', () => {
cy.visit('/app/customerror/missing-role');

cy.contains('button', 'Logout').should('be.visible').click();

cy.intercept({
method: 'POST',
url: '/auth/logout',
});

cy.getElementByTestId('submit').should('contain.text', 'Log in');
});
}

0 comments on commit 78b5e1e

Please sign in to comment.