+ <%= render "admin/users/index/search_field", f: f, placeholder: "Search member...", aria_label: "Search member by name, username, email, or Twitter/GitHub usernames" %>
<%= render "admin/users/index/filter_role_field", f: f %>
diff --git a/app/views/admin/users/index/_search_field.html.erb b/app/views/admin/users/index/_search_field.html.erb
index 25ca5e598..e466c4eff 100644
--- a/app/views/admin/users/index/_search_field.html.erb
+++ b/app/views/admin/users/index/_search_field.html.erb
@@ -1,4 +1,6 @@
-<%= f.text_field :search, value: params[:search], class: "crayons-textfield mt-0", placeholder: "Search member...", aria: { label: "Search member by name, username, email, or Twitter/GitHub usernames" } %>
-
+
+ <%= f.text_field :search, value: params[:search], class: "crayons-textfield mt-0", placeholder: placeholder, aria: { label: aria_label } %>
+
+
diff --git a/cypress/integration/seededFlows/adminFlows/users/invitedUsers.spec.js b/cypress/integration/seededFlows/adminFlows/users/invitedUsers.spec.js
new file mode 100644
index 000000000..31230bde1
--- /dev/null
+++ b/cypress/integration/seededFlows/adminFlows/users/invitedUsers.spec.js
@@ -0,0 +1,40 @@
+describe('Invited users', () => {
+ beforeEach(() => {
+ cy.testSetup();
+ cy.fixture('users/adminUser.json').as('user');
+ cy.get('@user').then((user) => {
+ cy.loginUser(user)
+ .then(() => cy.enableFeatureFlag('member_index_view'))
+ .then(() =>
+ cy.inviteUser({
+ name: 'Test user',
+ email: 'test@test.com',
+ }),
+ )
+ .then(() => cy.visitAndWaitForUserSideEffects('/admin/invitations'));
+ });
+ });
+
+ it('searches for an invited user', () => {
+ // The single invited user should be visible on the page
+ cy.findByText('test@test.com').should('exist');
+
+ // Search for a term that should match the entry
+ cy.findByRole('textbox', {
+ name: 'Search invited members by name, username, or email',
+ }).type('test');
+ cy.findByRole('button', { name: 'Search' }).click();
+ cy.url().should('contain', 'search=test');
+ cy.findByText('test@test.com').should('exist');
+
+ // Search for a term that shouldn't match the entry
+ cy.findByRole('textbox', {
+ name: 'Search invited members by name, username, or email',
+ })
+ .clear()
+ .type('something');
+ cy.findByRole('button', { name: 'Search' }).click();
+ cy.url().should('contain', 'search=something');
+ cy.findByText('test@test.com').should('not.exist');
+ });
+});
diff --git a/cypress/support/commands.js b/cypress/support/commands.js
index 27da76073..07c875a1f 100644
--- a/cypress/support/commands.js
+++ b/cypress/support/commands.js
@@ -391,3 +391,11 @@ Cypress.Commands.add(
return cy.wrap(subject).invoke('val', color).trigger('input');
},
);
+
+Cypress.Commands.add('inviteUser', ({ name, email }) => {
+ return cy.request(
+ 'POST',
+ '/admin/invitations',
+ `utf8=%E2%9C%93&user%5Bemail%5D=${email}&user%5Bname%5D=${name}&commit=Invite+User`,
+ );
+});