Fix error message and update and add tests (#2807)

* Fix user-fed-password-policy-error-message

* Add test for error messages

* Remove only function

* Change switch toggle

* Modify toggle

* Add save action

* Set error messages to constant

* Remove alert and message changes
This commit is contained in:
Aboullos 2022-06-21 14:15:29 +02:00 committed by GitHub
parent 0f5df6a5df
commit 64deaa5fb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 4 deletions

View file

@ -86,9 +86,8 @@ describe("Realm tests", () => {
cy.findByText("Delete").click();
modalUtils.confirmModal();
masthead.checkNotificationMessage("The realm has been deleted");
});
it("Should update realms on delete", () => {
// Show current realms
sidebarPage.showCurrentRealms(2);
});
@ -109,9 +108,8 @@ describe("Realm tests", () => {
masthead.checkNotificationMessage("Realm created");
cy.wait(["@fetch"]);
});
it("Should show current realms", () => {
// Show current realms
sidebarPage.showCurrentRealms(4);
});

View file

@ -88,6 +88,10 @@ const deletedSuccessMessage = "The user federation provider has been deleted.";
const deleteModalTitle = "Delete user federation provider?";
const disableModalTitle = "Disable user federation provider?";
const nonWritableFailMessage = "User federation provider could not be saved:";
const validatePasswordPolicyFailMessage =
"User federation provider could not be saved: Validate Password Policy is applicable only with WRITABLE edit mode";
const userImportingDisabledFailMessage =
"User federation provider could not be saved: Can not disable Importing users when LDAP provider mode is UNSYNCED";
const ldapTestSuccessMsg = "Successfully connected to LDAP";
const ldapTestFailMsg =
@ -427,8 +431,19 @@ describe("User Federation LDAP tests", () => {
providersPage.clickExistingCard(firstLdapName);
providersPage.fillSelect(providersPage.ldapEditModeInput, editModeUnsynced);
providersPage.toggleSwitch(providersPage.importUsers);
providersPage.save(provider);
masthead.checkNotificationMessage(validatePasswordPolicyFailMessage);
providersPage.toggleSwitch(providersPage.importUsers);
providersPage.toggleSwitch(providersPage.validatePwPolicySwitch);
providersPage.save(provider);
masthead.checkNotificationMessage(userImportingDisabledFailMessage);
providersPage.toggleSwitch(providersPage.importUsers);
providersPage.save(provider);
masthead.checkNotificationMessage(savedSuccessMessage);