From 4669cfe9cbcf53221d34d7d0d497c42d0a09de2f Mon Sep 17 00:00:00 2001 From: SebastEnn <103125747+SebastEnn@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:47:56 +0100 Subject: [PATCH] "Remove role" alert text is wrong (#36173) Closes #36172 Signed-off-by: SebastEnn <103125747+SebastEnn@users.noreply.github.com> --- .../admin-ui/cypress/e2e/clients_role.spec.ts | 4 ++-- .../admin-ui/cypress/e2e/clients_test.spec.ts | 4 +--- .../cypress/e2e/realm_roles_test.spec.ts | 20 ++++--------------- .../e2e/realm_user_registration.spec.ts | 2 +- .../components/role-mapping/RoleMapping.tsx | 4 ++-- 5 files changed, 10 insertions(+), 24 deletions(-) diff --git a/js/apps/admin-ui/cypress/e2e/clients_role.spec.ts b/js/apps/admin-ui/cypress/e2e/clients_role.spec.ts index 5faf196ead3..0c5ba9551da 100644 --- a/js/apps/admin-ui/cypress/e2e/clients_role.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/clients_role.spec.ts @@ -169,7 +169,7 @@ describe("Roles tab test", () => { commonPage .masthead() - .checkNotificationMessage("Scope mapping successfully removed", true); + .checkNotificationMessage("Role mapping updated", true); commonPage.tableUtils().selectRowItemAction("manage-consent", "Unassign"); commonPage.sidebar().waitForPageLoad(); @@ -197,7 +197,7 @@ describe("Roles tab test", () => { commonPage .masthead() - .checkNotificationMessage("Scope mapping successfully removed", true); + .checkNotificationMessage("Role mapping updated", true); }); it("Should delete client role test", () => { diff --git a/js/apps/admin-ui/cypress/e2e/clients_test.spec.ts b/js/apps/admin-ui/cypress/e2e/clients_test.spec.ts index d6cea089731..5c7b3caf9d2 100644 --- a/js/apps/admin-ui/cypress/e2e/clients_test.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/clients_test.spec.ts @@ -301,9 +301,7 @@ describe("Clients test", () => { commonPage.sidebar().waitForPageLoad(); commonPage.modalUtils().checkModalTitle("Remove role?").confirmModal(); - commonPage - .masthead() - .checkNotificationMessage("Scope mapping successfully removed"); + commonPage.masthead().checkNotificationMessage("Role mapping updated"); //cy.intercept(`/admin/realms/${realmName}/users`).as("assignRoles"); serviceAccountTab diff --git a/js/apps/admin-ui/cypress/e2e/realm_roles_test.spec.ts b/js/apps/admin-ui/cypress/e2e/realm_roles_test.spec.ts index e78e9959863..a5832fc5049 100644 --- a/js/apps/admin-ui/cypress/e2e/realm_roles_test.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/realm_roles_test.spec.ts @@ -173,10 +173,7 @@ describe("Realm roles test", () => { modalUtils.checkModalTitle("Remove role?").confirmModal(); sidebarPage.waitForPageLoad(); - masthead.checkNotificationMessage( - "Scope mapping successfully removed", - true, - ); + masthead.checkNotificationMessage("Role mapping updated", true); }); it("Should delete all roles from search bar", () => { @@ -192,10 +189,7 @@ describe("Realm roles test", () => { modalUtils.checkModalTitle("Remove role?").confirmModal(); sidebarPage.waitForPageLoad(); - masthead.checkNotificationMessage( - "Scope mapping successfully removed", - true, - ); + masthead.checkNotificationMessage("Role mapping updated", true); }); it("Should delete associated roles from list test", () => { @@ -223,19 +217,13 @@ describe("Realm roles test", () => { modalUtils.checkModalTitle("Remove role?").confirmModal(); sidebarPage.waitForPageLoad(); - masthead.checkNotificationMessage( - "Scope mapping successfully removed", - true, - ); + masthead.checkNotificationMessage("Role mapping updated", true); listingPage.removeItem("offline_access"); sidebarPage.waitForPageLoad(); modalUtils.checkModalTitle("Remove role?").confirmModal(); sidebarPage.waitForPageLoad(); - masthead.checkNotificationMessage( - "Scope mapping successfully removed", - true, - ); + masthead.checkNotificationMessage("Role mapping updated", true); }); describe("edit role details", () => { diff --git a/js/apps/admin-ui/cypress/e2e/realm_user_registration.spec.ts b/js/apps/admin-ui/cypress/e2e/realm_user_registration.spec.ts index 56fb8e23599..7624e945848 100644 --- a/js/apps/admin-ui/cypress/e2e/realm_user_registration.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/realm_user_registration.spec.ts @@ -58,7 +58,7 @@ describe("Realm settings - User registration tab", () => { .checkModalMessage("Are you sure you want to remove this role?") .checkConfirmButtonText("Remove") .confirmModal(); - masthead.checkNotificationMessage("Scope mapping successfully removed"); + masthead.checkNotificationMessage("Role mapping updated"); }); it("Add default group", () => { diff --git a/js/apps/admin-ui/src/components/role-mapping/RoleMapping.tsx b/js/apps/admin-ui/src/components/role-mapping/RoleMapping.tsx index 11f5d3b16c7..f11932aa828 100644 --- a/js/apps/admin-ui/src/components/role-mapping/RoleMapping.tsx +++ b/js/apps/admin-ui/src/components/role-mapping/RoleMapping.tsx @@ -172,11 +172,11 @@ export const RoleMapping = ({ onConfirm: async () => { try { await Promise.all(deleteMapping(adminClient, type, id, selected)); - addAlert(t("clientScopeRemoveSuccess"), AlertVariant.success); + addAlert(t("roleMappingUpdatedSuccess"), AlertVariant.success); setSelected([]); refresh(); } catch (error) { - addError("clientScopeRemoveError", error); + addError("roleMappingUpdatedError", error); } }, });