MM-59854 Fully allow at mentions in message attachment field values and add E2E tests (#28018)

* Add descriptions to test cases for getNeededAtMentionedUsernames

* MM-59854 Load users who are at-mentioned in message attachment fields

* MM-59854 Add server support for at-mentioning users in message attachment fields

* Migrate support/external_commands from JS to TS

* MM-59584 Ensure that at-mentions never show in other message attachment fields

* MM-59584 Add E2E tests for how we load users based on at mentions

* Use new E2E test helpers in other places

* Update snapshots
Этот коммит содержится в:
Harrison Healey
2024-09-24 09:41:03 -04:00
коммит произвёл GitHub
родитель 3e84d20dbe
Коммит 46cad5c552
22 изменённых файлов: 503 добавлений и 198 удалений

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

@@ -53,13 +53,8 @@ function createChannel(channelType, teamId, userToAdd = null) {
if (userToAdd) {
// # Get user profile by email
return cy.apiGetUserByEmail(userToAdd.email).then(({user}) => {
// # Add user to team
cy.externalRequest({
user: admin,
method: 'post',
path: `channels/${channel.id}/members`,
data: {user_id: user.id},
}).then(() => {
// # Add user to channel
cy.externalAddUserToChannel(user.id, channel.id).then(() => {
// # Explicitly wait to give some time to index before searching
cy.wait(TIMEOUTS.TWO_SEC);
return cy.wrap(channel);

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

@@ -11,7 +11,6 @@
// Group: @channels @enterprise @system_console
import * as TIMEOUTS from '../../../../../fixtures/timeouts';
import {getAdminAccount} from '../../../../../support/env';
describe('System Console > Site Statistics', () => {
let testTeam;
@@ -102,8 +101,6 @@ describe('System Console > Site Statistics', () => {
it('MM-T902 - Reporting ➜ Site statistics line graphs show same date', () => {
cy.intercept('**/api/v4/**').as('resources');
const sysadmin = getAdminAccount();
let newChannel;
// # Create and visit new channel
@@ -114,7 +111,7 @@ describe('System Console > Site Statistics', () => {
// # Create a bot and get userID
cy.apiCreateBot().then(({bot}) => {
const botUserId = bot.user_id;
cy.externalRequest({user: sysadmin, method: 'put', path: `users/${botUserId}/roles`, data: {roles: 'system_user system_post_all system_admin'}});
cy.externalUpdateUserRoles(botUserId, 'system_user system_post_all system_admin');
// # Get token from bots id
cy.apiAccessToken(botUserId, 'Create token').then(({token}) => {

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

@@ -60,7 +60,7 @@ const setUserTeamAndChannelMemberships = (user, team, channel, channelAdmin = fa
const admin = getAdminAccount();
// # Set user as regular system user
cy.externalRequest({user: admin, method: 'put', path: `users/${user.id}/roles`, data: {roles: 'system_user'}});
cy.externalUpdateUserRoles(user.id, 'system_user');
// # Get team membership
cy.externalRequest({user: admin, method: 'put', path: `teams/${team.id}/members/${user.id}/schemeRoles`, data: {scheme_user: true, scheme_admin: teamAdmin}});

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

@@ -91,7 +91,7 @@ const setUserTeamAndChannelMemberships = (user, team, channel, channelAdmin = fa
const admin = getAdminAccount();
// # Set user as regular system user
cy.externalRequest({user: admin, method: 'put', path: `users/${user.id}/roles`, data: {roles: 'system_user'}});
cy.externalUpdateUserRoles(user.id, 'system_user');
// # Get team membership
cy.externalRequest({user: admin, method: 'put', path: `teams/${team.id}/members/${user.id}/schemeRoles`, data: {scheme_user: true, scheme_admin: teamAdmin}});