[MM-54296] Admin Reporting for Users, new User Management screen (#26055)

* trial commit

* [MM-56172] Integrate fetching and sorting of user reporting into the table component (#25749)

* inint

* lint

* Update system_users.test.tsx.snap

* cypress test fix

* added pkg

* revoke sessio into new compo

* Update system_users.test.tsx.snap

* trans

* more disable

* rename

* Update system_users_dropdown.test.tsx

* snap

* Delete system_users_list.test.tsx.snap

* Create system_users_list.test.tsx.snap

* Delete system_users_list.test.tsx.snap

* name2

* start removing the filter from the list

* more clean

* snaps

* Update package-lock.json

* des

* Update index.scss

* Update system_users_list.tsx

* Update system_users_list.tsx

* Update system_users.tsx

* Update system_users_list.tsx

* Update index.scss

* menu

* action menu

* split

* Update system_users_list.tsx

* Update system_users_list_new.tsx

* fix

* Update en.json

* temp remove

* Update system_users.test.tsx.snap

* Delete system_users_list.test.tsx.snap

* Update en.json

* ch

* move

* a

* Update en.json

* fix

* Update system_users.test.tsx.snap

* Update menu.tsx

* Update admin_header.tsx

* changes in the file system

* fixes

* integration begin

* lint

* Update rhs.ts

* upper pagination

* Update list_table.scss

* pinned

* more a11y

* Update list_table.scss

* i18n mor

* design changes

* descriptions

* lint

* loading states

* fix

* actions update

* index fix

* single action

---------

Co-authored-by: Mattermost Build <build@mattermost.com>

* [MM-56467] Clear up unused code of old systems users (#25855)

* ccc

* Update en.json

* [MM-56478] Improve the user loading in user details page after changes in users list page in admin console (#25861)

* init

* tem

* more fix

* handlers clear up, team's fixes

---------

Co-authored-by: Mattermost Build <build@mattermost.com>

* Merge'd

* [MM-56279] Add paging to user list (#25863)

* Update system_users.tsx

* Update system_users.tsx

* [MM-56270] Hook up user actions menu, refactor modals to work with new menuing style (#25897)

* Hookup menu items and modals

* Add error handling, test fixes

* Ensure modals animate properly

* Add a bunch of TODOs around keeping the user data up to date

* Fix i18n and snaps

---------

Co-authored-by: Mattermost Build <build@mattermost.com>

* [MM-56263] Enable selective column hiding for users table (#25898)

* [MM-56539] Revisiting the design of the total users count on the left and in pagination in users table (#25947)

* default sort order

* default sort order (#25956)

Co-authored-by: Mattermost Build <build@mattermost.com>

* [MM-56267] Add search term filtering (#25952)

* Include search term with request

* Update user count with filtering

* Oops

* Add 500ms debounce to avoid spamming server with requests

* PR feedback

---------

Co-authored-by: Mattermost Build <build@mattermost.com>

* [MM-56398] Add date range filter to user reporting table (#25974)

* WIP

* Some small adjustments

* Two fixes

* PR feedback

* Remove menuitem

---------

Co-authored-by: Mattermost Build <build@mattermost.com>

* Merge'd

* [MM-56615] Add messaging for MySQL instances around the post stats (#26036)

* [MM-56261] Add export modals and hook up button to user management screen (#26015)

* [MM-56576] Update users when actions occur and show errors when actions fail (#25951)

* [MM-56576] Update users when actions occur and show errors when actions fail

* Forgot the else

* PR feedback

* [MM-56617] Move action modals to ConfirmModalRedux

* Add filters popover to the users admin table (#26042)

* int

* 0 zeros

* dd

* re

* file move

* Update system_users_filter_popover.scss

* a

* Update system_users_filter_popover.scss

* role and status

* fix

* Update index.test.ts

* overlay

* Update dropdown_input.tsx

* i

* Update en.json

* done

* Update en.json

* dd

---------

Co-authored-by: Mattermost Build <build@mattermost.com>

* Make column toggler column menu items consistent with table column names

* Couple typo fixes

* Fix i18n

* some e2e related changes

* Fixed issue where you couldn't queue multiple batch export jobs

* Fix id tag

* table header mis allignment issue solved

* [MM-56727] Fix a TODO, fix Demote to guest should only appear when enabled

* rev comments

* Stop sending down all profile data

* chore(e2e): Fix tests cases for new user Management ui (#26089)

* chore(e2e): Fix lint issues in cypress tests

* chore(e2e): Fix e2e tests

- user_management_spec
- authentication_method_spec

* [MM-56710] Revert to in-memory compilation of CSV report

* Update system_users.tsx

* Merge'd

* Fix test

---------

Co-authored-by: M-ZubairAhmed <m-zubairahmed@protonmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: yasserfaraazkhan <attitude3cena.yf@gmail.com>
Этот коммит содержится в:
Devin Binnie
2024-02-07 08:56:59 -05:00
коммит произвёл GitHub
родитель 4f3eba381b
Коммит 03f71c9c84
108 изменённых файлов: 4701 добавлений и 6095 удалений

Просмотреть файл

@@ -12,6 +12,7 @@
import {createBotPatch} from '../../../support/api/bots';
import {generateRandomUser} from '../../../support/api/user';
import * as TIMEOUTS from '../../../fixtures/timeouts';
describe('Bots in lists', () => {
let team;
@@ -59,13 +60,13 @@ describe('Bots in lists', () => {
bots.forEach(({username}) => {
// # Search for bot
cy.get('#searchUsers').clear().type(`@${username}`);
cy.get('#input_searchTerm').clear().type(`${username}`).wait(TIMEOUTS.ONE_SEC);
// * Verify bot not in list
cy.findByTestId('noUsersFound').should('have.text', 'No users found');
cy.get('.noRows').should('have.text', 'No data');
// * Verify pseudo checksum total of non bot users
cy.get('#searchableUserListTotal').contains('0 users of').should('be.visible');
cy.get('.adminConsoleListTabletOptionalHead > span').should('have.text', '0 users').should('be.visible');
});
});
});

Просмотреть файл

@@ -58,11 +58,10 @@ describe('Authentication', () => {
// # Navigate to System Console -> User Management -> Users
cy.visit('/admin_console/user_management/users');
cy.get('#searchUsers', {timeout: TIMEOUTS.ONE_MIN}).type(testUser.email);
cy.findByPlaceholderText('Search users').type(testUser.username).wait(TIMEOUTS.HALF_SEC);
// * Remove MFA option not available for the user
cy.wait(TIMEOUTS.HALF_SEC);
cy.findByTestId('userListRow').find('.MenuWrapper a').should('be.visible').click();
cy.get('#systemUsersTable-cell-0_actionsColumn').click().wait(TIMEOUTS.HALF_SEC);
cy.findByText('Remove MFA').should('not.exist');
cy.apiLogout();
@@ -105,11 +104,10 @@ describe('Authentication', () => {
// # Navigate to System Console -> User Management -> Users
cy.visit('/admin_console/user_management/users');
cy.get('#searchUsers', {timeout: TIMEOUTS.ONE_MIN}).type(testUser.email);
cy.findByPlaceholderText('Search users').type(testUser.username).wait(TIMEOUTS.HALF_SEC);
// * Remove MFA option available for the user and click it
cy.wait(TIMEOUTS.HALF_SEC);
cy.findByTestId('userListRow').find('.MenuWrapper a').should('be.visible').click();
cy.get('#systemUsersTable-cell-0_actionsColumn').click().wait(TIMEOUTS.HALF_SEC);
cy.findByText('Remove MFA').should('be.visible').click();
// # Navigate to System Console -> Authentication -> MFA Page.
@@ -121,6 +119,7 @@ describe('Authentication', () => {
// # Click "Save".
cy.findByText('Save').click().wait(TIMEOUTS.ONE_SEC);
cy.apiLogout();
// # Login as test user
cy.apiLogin(testUser);
@@ -138,11 +137,11 @@ describe('Authentication', () => {
// # Navigate to System Console -> User Management -> Users
cy.visit('/admin_console/user_management/users');
cy.get('#searchUsers', {timeout: TIMEOUTS.ONE_MIN}).type(testUser.email);
cy.findByPlaceholderText('Search users').type(testUser.username).wait(TIMEOUTS.HALF_SEC);
// * Remove MFA option available for the user and click it
cy.wait(TIMEOUTS.HALF_SEC);
cy.findByTestId('userListRow').find('.MenuWrapper a').should('be.visible').click();
cy.get('#systemUsersTable-cell-0_actionsColumn').click().wait(TIMEOUTS.HALF_SEC);
cy.findByText('Remove MFA').should('not.exist');
// # Done with that MFA stuff so we disable it all

Просмотреть файл

@@ -127,12 +127,11 @@ describe('Guest Account - Guest User Invitation Flow', () => {
cy.visit('/admin_console/user_management/users');
// # Search for User by username and select the option to update email
cy.get('#searchUsers').should('be.visible').type(guest.username);
cy.findByPlaceholderText('Search users').should('be.visible').type(guest.username).wait(TIMEOUTS.ONE_SEC);
// # Click on the option to update email
cy.wait(TIMEOUTS.HALF_SEC);
cy.findByTestId('userListRow').find('.MenuWrapper a').should('be.visible').click();
cy.findByText('Update Email').should('be.visible').click();
cy.get('#systemUsersTable-cell-0_actionsColumn').click();
cy.findByText('Update email').should('be.visible').click();
// * Update email outside whitelisted domain and verify error message
cy.findByTestId('resetEmailModal').should('be.visible').within(() => {

Просмотреть файл

@@ -18,8 +18,6 @@ import * as TIMEOUTS from '../../../../fixtures/timeouts';
import {getRandomId} from '../../../../utils';
import {getAdminAccount} from '../../../../support/env';
import {verifyGuest} from './helpers';
describe('Guest Account - Verify Manage Guest Users', () => {
const admin = getAdminAccount();
let guestUser: Cypress.UserProfile;
@@ -60,18 +58,15 @@ describe('Guest Account - Verify Manage Guest Users', () => {
cy.reload();
// # Search for Guest User by username
cy.get('#searchUsers', {timeout: TIMEOUTS.HALF_MIN}).should('be.visible').type(guestUser.username);
cy.findByPlaceholderText('Search users').should('be.visible').type(guestUser.username).wait(TIMEOUTS.TWO_SEC);
});
it('MM-T1391 Verify the manage options displayed for Guest User', () => {
// * Verify Guest user
verifyGuest();
// # Click on the Manage User option
cy.wait(TIMEOUTS.HALF_SEC).findByTestId('userListRow').find('.MenuWrapper a').should('be.visible').click();
// * Verify Guest user and Click on the Manage User option
cy.get('#systemUsersTable-cell-0_actionsColumn').should('have.text', 'Guest').click();
// * Verify the manage options which should be displayed for Guest User
const includeOptions = ['Deactivate', 'Manage Roles', 'Manage Teams', 'Reset Password', 'Update Email', 'Promote to Member', 'Revoke Sessions'];
const includeOptions = ['Deactivate', 'Manage roles', 'Manage teams', 'Reset password', 'Update email', 'Promote to member', 'Remove sessions'];
includeOptions.forEach((includeOption) => {
cy.findByText(includeOption).should('be.visible');
});
@@ -85,8 +80,8 @@ describe('Guest Account - Verify Manage Guest Users', () => {
it('MM-18048 Change Email of a Guest User and Verify', () => {
// # Click on the Update Email option
cy.wait(TIMEOUTS.HALF_SEC).findByTestId('userListRow').find('.MenuWrapper a').should('be.visible').click();
cy.wait(TIMEOUTS.HALF_SEC).findByText('Update Email').click();
cy.get('#systemUsersTable-cell-0_actionsColumn').should('have.text', 'Guest').click();
cy.findByText('Update email').click();
// * Update email of Guest User
const email = `temp-${getRandomId()}@mattermost.com`;
@@ -100,14 +95,14 @@ describe('Guest Account - Verify Manage Guest Users', () => {
// # Reload and verify if behavior is same
cy.reload();
cy.get('#searchUsers').should('be.visible').type(guestUser.username);
cy.findByPlaceholderText('Search users').should('be.visible').type(guestUser.username);
cy.findByText(email).should('be.visible');
});
it('MM-18048 Revoke Session of a Guest User and Verify', () => {
// # Click on the Revoke Session option
cy.wait(TIMEOUTS.HALF_SEC).findByTestId('userListRow').find('.MenuWrapper a').should('be.visible').click();
cy.wait(TIMEOUTS.HALF_SEC).findByText('Revoke Sessions').click();
cy.get('#systemUsersTable-cell-0_actionsColumn').should('have.text', 'Guest').click();
cy.findByText('Remove sessions').click();
// * Verify the confirmation message displayed
cy.get('#confirmModal').should('be.visible').within(() => {

Просмотреть файл

@@ -65,44 +65,36 @@ describe('Settings', () => {
const adminUsername = getAdminAccount().username;
// # Type sysadmin
cy.get('#searchUsers').clear().type(adminUsername).wait(TIMEOUTS.HALF_SEC);
cy.findByPlaceholderText('Search users').clear().type(adminUsername).wait(TIMEOUTS.TWO_SEC);
// * Verify sign-in method
cy.findByTestId('userListRow').within(() => {
cy.get('.more-modal__details').
should('be.visible').
and('contain.text', 'Sign-in Method: Email');
});
// * Verify sign-in method from user profile
cy.get('.displayName').click();
cy.get('.AdminUserCard__body > :nth-child(4) > span:nth-child(3)').should('have.text', 'Email');
cy.get('a.back').click();
// # Type saml user
cy.get('#searchUsers').clear().type(samlUser.username).wait(TIMEOUTS.HALF_SEC);
cy.findByPlaceholderText('Search users').clear().type(samlUser.username).wait(TIMEOUTS.TWO_SEC);
// * Verify sign-in method
cy.findByTestId('userListRow').within(() => {
cy.get('.more-modal__details').
should('be.visible').
and('contain.text', 'Sign-in Method: SAML');
});
// * Verify sign-in method from user profile
cy.get('.displayName').click();
cy.get('.AdminUserCard__body > :nth-child(4) > span:nth-child(3)').should('have.text', 'SAML');
cy.get('a.back').click();
// # Type ldap user
cy.get('#searchUsers').clear().type(ldapUser.username).wait(TIMEOUTS.HALF_SEC);
cy.findByPlaceholderText('Search users').clear().type(ldapUser.username).wait(TIMEOUTS.TWO_SEC);
// * Verify sign-in method
cy.findByTestId('userListRow').within(() => {
cy.get('.more-modal__details').
should('be.visible').
and('contain.text', 'Sign-in Method: LDAP');
});
// * Verify sign-in method from user profile
cy.get('.displayName').click();
cy.get('.AdminUserCard__body > :nth-child(4) > span:nth-child(3)').should('have.text', 'LDAP');
cy.get('a.back').click();
// # Type mfa user
cy.get('#searchUsers').clear().type(mfaUser.username).wait(TIMEOUTS.HALF_SEC);
cy.findByPlaceholderText('Search users').clear().type(mfaUser.username).wait(TIMEOUTS.TWO_SEC);
// * Verify sign-in method
cy.findByTestId('userListRow').within(() => {
cy.get('.more-modal__details').
should('be.visible').
and('contain.text', 'MFA: Yes');
});
// * Verify sign-in method from user profile
cy.get('.displayName').click();
cy.get('.AdminUserCard__body > :nth-child(4) > span:nth-child(3)').should('contain.text', 'MFA');
cy.get('a.back').click();
});
});

Просмотреть файл

@@ -49,7 +49,7 @@ describe('System Console > User Management > Users', () => {
wait(TIMEOUTS.HALF_SEC);
// # Click on the searched user name
cy.findByText(`@${testUser.username}`).
cy.findByText(`${testUser.username}`).
should('be.visible').
click({force: true});
@@ -67,15 +67,13 @@ describe('System Console > User Management > Users', () => {
it('MM-T932 Users - Change a user\'s password', () => {
// # Search for the user.
cy.get('#searchUsers').type(testUser.email).wait(TIMEOUTS.HALF_SEC);
cy.findByPlaceholderText('Search users').type(testUser.email).wait(TIMEOUTS.HALF_SEC);
// # Open the actions menu.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .text-right a').
click().wait(TIMEOUTS.HALF_SEC);
cy.get('#systemUsersTable-cell-0_actionsColumn').click().wait(TIMEOUTS.HALF_SEC);
// # Click the Reset Password menu option.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .MenuWrapperAnimation-enter-done').
find('li').eq(3).click().wait(TIMEOUTS.HALF_SEC);
cy.findByText('Reset password').click();
// # Type new password and submit.
cy.get('input[type=password]').type('new' + testUser.password);
@@ -99,22 +97,20 @@ describe('System Console > User Management > Users', () => {
it('MM-T933 Users - System admin changes own password - Cancel out of changes', () => {
// # Search for the admin.
cy.get('#searchUsers').type(otherAdmin.username).wait(TIMEOUTS.HALF_SEC);
cy.findByPlaceholderText('Search users').type(otherAdmin.username).wait(TIMEOUTS.HALF_SEC);
// # Open the actions menu.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .text-right a').
click().wait(TIMEOUTS.HALF_SEC);
cy.get('#systemUsersTable-cell-0_actionsColumn').click().wait(TIMEOUTS.HALF_SEC);
// # Click the Reset Password menu option.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .MenuWrapperAnimation-enter-done').
find('li').eq(2).click().wait(TIMEOUTS.HALF_SEC);
cy.findByText('Reset password').click();
// # Type current password and a new password.
cy.get('input[type=password]').eq(0).type(otherAdmin.password);
cy.get('input[type=password]').eq(1).type('new' + otherAdmin.password);
// # Click the 'Cancel' button.
cy.get('button[type=button].btn.btn-link').should('contain', 'Cancel').click().wait(TIMEOUTS.HALF_SEC);
cy.get('.modal-footer > .btn-tertiary').should('contain', 'Cancel').click().wait(TIMEOUTS.HALF_SEC);
// # Log out.
cy.apiLogout();
@@ -125,15 +121,13 @@ describe('System Console > User Management > Users', () => {
it('MM-T934 Users - System admin changes own password - Incorrect old password', () => {
// # Search for the admin.
cy.get('#searchUsers').type(otherAdmin.username).wait(TIMEOUTS.HALF_SEC);
cy.findByPlaceholderText('Search users').type(otherAdmin.username).wait(TIMEOUTS.HALF_SEC);
// # Open the actions menu.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .text-right a').
click().wait(TIMEOUTS.HALF_SEC);
cy.get('#systemUsersTable-cell-0_actionsColumn').click().wait(TIMEOUTS.HALF_SEC);
// # Click the Reset Password menu option.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .MenuWrapperAnimation-enter-done').
find('li').eq(2).click().wait(TIMEOUTS.HALF_SEC);
cy.findByText('Reset password').click();
// # Type wrong current password and a new password.
cy.get('input[type=password]').eq(0).type('wrong' + otherAdmin.password);
@@ -149,15 +143,13 @@ describe('System Console > User Management > Users', () => {
it('MM-T935 Users - System admin changes own password - Invalid new password', () => {
// # Search for the admin.
cy.get('#searchUsers').type(otherAdmin.username).wait(TIMEOUTS.HALF_SEC);
cy.findByPlaceholderText('Search users').type(otherAdmin.username).wait(TIMEOUTS.HALF_SEC);
// # Open the actions menu.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .text-right a').
click().wait(TIMEOUTS.HALF_SEC);
cy.get('#systemUsersTable-cell-0_actionsColumn').click().wait(TIMEOUTS.HALF_SEC);
// # Click the Reset Password menu option.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .MenuWrapperAnimation-enter-done').
find('li').eq(2).click().wait(TIMEOUTS.HALF_SEC);
cy.findByText('Reset password').click();
// # Type current password and a new too short password.
cy.get('input[type=password]').eq(0).type(otherAdmin.password);
@@ -173,15 +165,13 @@ describe('System Console > User Management > Users', () => {
it('MM-T936 Users - System admin changes own password - Blank fields', () => {
// # Search for the admin.
cy.get('#searchUsers').type(otherAdmin.username).wait(TIMEOUTS.HALF_SEC);
cy.findByPlaceholderText('Search users').type(otherAdmin.username).wait(TIMEOUTS.HALF_SEC);
// # Open the actions menu.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .text-right a').
click().wait(TIMEOUTS.HALF_SEC);
cy.get('#systemUsersTable-cell-0_actionsColumn').click().wait(TIMEOUTS.HALF_SEC);
// # Click the Reset Password menu option.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .MenuWrapperAnimation-enter-done').
find('li').eq(2).click().wait(TIMEOUTS.HALF_SEC);
cy.findByText('Reset password').click();
// # Click the 'Reset' button.
cy.get('button[type=submit] span').should('contain', 'Reset').click().wait(TIMEOUTS.HALF_SEC);
@@ -203,15 +193,13 @@ describe('System Console > User Management > Users', () => {
it('MM-T937 Users - System admin changes own password - Successfully changed', () => {
// # Search for the admin.
cy.get('#searchUsers').type(otherAdmin.username).wait(TIMEOUTS.HALF_SEC);
cy.findByPlaceholderText('Search users').type(otherAdmin.username).wait(TIMEOUTS.HALF_SEC);
// # Open the actions menu.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .text-right a').
click().wait(TIMEOUTS.HALF_SEC);
cy.get('#systemUsersTable-cell-0_actionsColumn').click().wait(TIMEOUTS.HALF_SEC);
// # Click the Reset Password menu option.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .MenuWrapperAnimation-enter-done').
find('li').eq(2).click().wait(TIMEOUTS.HALF_SEC);
cy.findByText('Reset password').click();
// # Type current and new passwords..
cy.get('input[type=password]').eq(0).type(otherAdmin.password);

Просмотреть файл

@@ -52,20 +52,20 @@ describe('User Management', () => {
cy.visit('/admin_console/user_management/users');
cy.get('#searchableUserListTotal').then((el) => {
cy.get('.adminConsoleListTabletOptionalHead > span').then((el) => {
const count1 = el[0].innerText.replace(/\n/g, '').replace(/\s/g, ' ');
// * Can page through several pages of users.
cy.get('#searchableUserListNextBtn').should('be.visible').click();
cy.get('.adminConsoleListTabletOptionalHead > .paginationButtons > [aria-label="Go to next page"]').should('be.visible').click();
// * Count at top changes appropriately.
cy.get('#searchableUserListTotal').then((el2) => {
cy.get('.adminConsoleListTabletOptionalHead > span').then((el2) => {
const count2 = el2[0].innerText.replace(/\n/g, '').replace(/\s/g, ' ');
expect(count1).not.equal(count2);
});
// * Can page backward as well.
cy.get('#searchableUserListPrevBtn').should('be.visible').click();
cy.get('.adminConsoleListTabletOptionalHead > .paginationButtons > [aria-label="Go to previous page"]').should('be.visible').click();
});
});
@@ -103,10 +103,8 @@ describe('User Management', () => {
resetUserEmail(testUser.email, newEmailAddr, '');
// # Updates immediately in Profile for the user.
cy.get('#searchUsers').clear().type(newEmailAddr).wait(TIMEOUTS.HALF_SEC);
cy.get('.more-modal__details').should('be.visible').within(() => {
cy.findByText(newEmailAddr).should('exist');
});
cy.get('#input_searchTerm').clear().type(newEmailAddr).wait(TIMEOUTS.HALF_SEC);
cy.get('#systemUsersTable-cell-0_emailColumn').should('have.text', newEmailAddr);
// * User also receives email confirmation that email address has been changed.
checkResetEmail(testUser, newEmailAddr);
@@ -186,15 +184,21 @@ describe('User Management', () => {
cy.apiUpdateUserAuth(gitlabUser.id, gitlabUser.email, '', 'gitlab');
// # Search for the user.
cy.get('#searchUsers').clear().type(gitlabUser.email).wait(TIMEOUTS.HALF_SEC);
cy.get('#input_searchTerm').clear().type(gitlabUser.email).wait(TIMEOUTS.HALF_SEC);
cy.findByTestId('userListRow').within(() => {
// # Open the actions menu.
cy.findByText('Member').click().wait(TIMEOUTS.HALF_SEC);
// # Open actions menu.
cy.get('#systemUsersTable-cell-0_actionsColumn').click();
// # Click the Update email menu option.
cy.findByLabelText('User Actions Menu').findByText('Update Email').should('not.exist');
});
// * Verify Switch to Email/Password is visible.
cy.findByText('Switch to Email/Password').should('be.visible').click().wait(TIMEOUTS.HALF_SEC);
// # Set new password.
cy.get('input[type=password]').type('new' + testUser.password);
cy.get('button[type=submit]').should('contain', 'Reset').click().wait(TIMEOUTS.HALF_SEC);
// * Verify Update email option is visible.
cy.get('#systemUsersTable-cell-0_actionsColumn').click().wait(TIMEOUTS.HALF_SEC);
cy.findByText('Update email').should('be.visible');
});
});
@@ -222,15 +226,10 @@ describe('User Management', () => {
cy.visit('/admin_console/user_management/users');
// # Search for the user.
cy.get('#searchUsers').clear().type(oldEmail).wait(TIMEOUTS.HALF_SEC);
cy.get('#input_searchTerm').clear().type(oldEmail).wait(TIMEOUTS.HALF_SEC);
cy.findByTestId('userListRow').within(() => {
// # Open the actions menu.
cy.findByText('Member').click().wait(TIMEOUTS.HALF_SEC);
// # Click the Update email menu option.
cy.findByLabelText('User Actions Menu').findByText('Update Email').click().wait(TIMEOUTS.HALF_SEC);
});
cy.get('#systemUsersTable-cell-0_actionsColumn').click().wait(TIMEOUTS.HALF_SEC);
cy.findByText('Update email').click().wait(TIMEOUTS.HALF_SEC);
// # Verify the modal opened.
cy.findByTestId('resetEmailModal').should('exist');