Added Cypress tests and few optimizations (#24592)
* added e2e test * Cleanup * Unused permission * Minor changes * Added case when there is no common team * More tests * nit
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
06765b1f44
Коммит
52072ccf31
9
e2e-tests/cypress/tests/support/api/channel.d.ts
поставляемый
9
e2e-tests/cypress/tests/support/api/channel.d.ts
поставляемый
@@ -212,5 +212,14 @@ declare namespace Cypress {
|
||||
* });
|
||||
*/
|
||||
apiCreateArchivedChannel(name: string, displayName: string, type: string, teamId: string, messages?: string[], user?: UserProfile): Chainable<Channel>;
|
||||
|
||||
/**
|
||||
* Command to convert a GM to a private channel
|
||||
* @param {string} channelId - channel id of GM to be converted
|
||||
* @param {string} teamId - id of team to move the converted private channel to
|
||||
* @param {string} displayName - display name of converted channel
|
||||
* @param {string} name - name of converted channel
|
||||
*/
|
||||
apiConvertGMToPrivateChannel(channelId: string, teamId: string, displayName: string, name: string): Chainable;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,3 +186,19 @@ Cypress.Commands.add('apiCreateArchivedChannel', (name, displayName, type = 'O',
|
||||
return cy.wrap(channel);
|
||||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add('apiConvertGMToPrivateChannel', (channelId, teamId, displayName, name) => {
|
||||
const body = {
|
||||
channel_id: channelId,
|
||||
team_id: teamId,
|
||||
display_name: displayName,
|
||||
name,
|
||||
};
|
||||
|
||||
return cy.request({
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
url: `/api/v4/channels/${channelId}/convert_to_channel?team_id=${teamId}`,
|
||||
method: 'POST',
|
||||
body,
|
||||
});
|
||||
});
|
||||
|
||||
Ссылка в новой задаче
Block a user