diff --git a/cypress/integration/realm_roles_test.spec.ts b/cypress/integration/realm_roles_test.spec.ts index a13294ea89..a0ef18c064 100644 --- a/cypress/integration/realm_roles_test.spec.ts +++ b/cypress/integration/realm_roles_test.spec.ts @@ -89,13 +89,13 @@ describe("Realm roles test", function () { // Add associated client role - cy.get('[data-cy=add-role-button]').click(); + cy.get("[data-cy=add-role-button]").click(); cy.wait(100); - cy.get('[data-cy=filter-type-dropdown]').click() + cy.get("[data-cy=filter-type-dropdown]").click(); - cy.get('[data-cy=filter-type-dropdown-item]').click() + cy.get("[data-cy=filter-type-dropdown-item]").click(); cy.wait(2500); @@ -104,6 +104,11 @@ describe("Realm roles test", function () { cy.get("#add-associated-roles-button").contains("Add").click(); cy.wait(2500); + + cy.contains("Users in role") + .click() + .get("#users-empty-state > div > h4") + .contains("No direct users"); }); }); }); diff --git a/src/components/list-empty-state/ListEmptyState.tsx b/src/components/list-empty-state/ListEmptyState.tsx index 3a805477d6..68ff13df0b 100644 --- a/src/components/list-empty-state/ListEmptyState.tsx +++ b/src/components/list-empty-state/ListEmptyState.tsx @@ -18,6 +18,7 @@ export type Action = { }; export type ListEmptyStateProps = { + id?: string, message: string; instructions: string; primaryActionText?: string; @@ -28,6 +29,7 @@ export type ListEmptyStateProps = { }; export const ListEmptyState = ({ + id, message, instructions, onPrimaryAction, @@ -38,7 +40,7 @@ export const ListEmptyState = ({ }: ListEmptyStateProps) => { return ( <> - + {hasIcon && isSearchVariant ? ( ) : ( diff --git a/src/realm-roles/RealmRoleTabs.tsx b/src/realm-roles/RealmRoleTabs.tsx index c0d9a68f90..7fb746d589 100644 --- a/src/realm-roles/RealmRoleTabs.tsx +++ b/src/realm-roles/RealmRoleTabs.tsx @@ -343,7 +343,7 @@ export const RealmRoleTabs = () => { eventKey="users-in-role" title={{t("usersInRole")}} > - + )} diff --git a/src/realm-roles/UsersInRoleTab.tsx b/src/realm-roles/UsersInRoleTab.tsx index 343c3bfc2a..6b1112aaa1 100644 --- a/src/realm-roles/UsersInRoleTab.tsx +++ b/src/realm-roles/UsersInRoleTab.tsx @@ -38,7 +38,7 @@ export const UsersInRoleTab = () => { hasIcon={true} message={t("noDirectUsers")} instructions={t("noUsersEmptyStateDescription")} - primaryActionText={t("addUser")} + id="users-empty-state" /> ) : (