From 810d5cf3a6e5d4cc166b42c1dfdb59151a8d0f2a Mon Sep 17 00:00:00 2001 From: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com> Date: Thu, 5 May 2022 13:24:06 -0600 Subject: [PATCH] "Empty State" for Invited Members (#17571) * WIP: Adds an empty state to the invitations table * Pulls invited member empty state into partial * WIP: Center empty state within invited members table body * Removes partial and adjusts empty space styling * Adds an e2e for the empty state to invitedUsers.spec.js * Moves empty state outside of table and adds aria-describedby to table * Update app/views/admin/invitations/index.html.erb Co-authored-by: Suzanne Aitchison * Adjusts ara-describedby erb tag * Updates the route used within invitedUsers.spec.js to fix e2e failure Co-authored-by: Suzanne Aitchison --- app/views/admin/invitations/index.html.erb | 12 +++++++++++- .../adminFlows/users/invitedUsers.spec.js | 14 ++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/app/views/admin/invitations/index.html.erb b/app/views/admin/invitations/index.html.erb index e31955f82..666c522c0 100644 --- a/app/views/admin/invitations/index.html.erb +++ b/app/views/admin/invitations/index.html.erb @@ -55,7 +55,7 @@ - + > @@ -83,6 +83,16 @@ + <% if @invitations.empty? %> +
+

No members invited yet.

+

Invite members and grow your community.

+
+
+ <%= link_to "Invite member", new_admin_invitation_path, class: "c-cta c-cta--branded ml-3" %> +
+ <% end %> +
<%= paginate @invitations, theme: "admin", scope: @invitations, label: "Paginate invitations", context: "bottom" %> diff --git a/cypress/integration/seededFlows/adminFlows/users/invitedUsers.spec.js b/cypress/integration/seededFlows/adminFlows/users/invitedUsers.spec.js index 9ee310312..a06d83610 100644 --- a/cypress/integration/seededFlows/adminFlows/users/invitedUsers.spec.js +++ b/cypress/integration/seededFlows/adminFlows/users/invitedUsers.spec.js @@ -135,3 +135,17 @@ describe('Invited users', () => { cy.findByRole('button', { name: 'Cancel invite' }).click(); }; }); + +describe('No invited members', () => { + beforeEach(() => { + cy.testSetup(); + cy.fixture('users/adminUser.json').as('user'); + cy.get('@user').then((user) => { + cy.loginAndVisit(user, '/admin/member_manager/invitations'); + }); + }); + + it('displays an empty state', () => { + cy.findByText('No members invited yet.').should('exist'); + }); +});