refactor: convert channel_moderation files to ts (#28482)

* refactor: convert channel_moderation files to ts

- convert js files to ts
- update data types accordingly
- fix lint issues

Fixes: #21332

* fix: update argument type for visitChannel

- update type
- fix types issues

* refactor: change return type for getAdminAccount()

- change return type to getAdminAccount as UserProfile
Этот коммит содержится в:
Angel Mendez
2024-10-08 06:12:57 -06:00
коммит произвёл GitHub
родитель f0918e1c01
Коммит 89f04af631
10 изменённых файлов: 57 добавлений и 37 удалений

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

@@ -1,6 +1,8 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {UserProfile} from '@mattermost/types/users';
export interface User {
username: string;
password: string;
@@ -12,7 +14,7 @@ export function getAdminAccount() {
username: Cypress.env('adminUsername'),
password: Cypress.env('adminPassword'),
email: Cypress.env('adminEmail'),
};
} as UserProfile;
}
export function getDBConfig() {

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

@@ -13,7 +13,7 @@ import {getRandomId} from '../utils';
function externalActivateUser(userId: string, active = true) {
const admin = getAdminAccount();
cy.externalRequest({user: admin, method: 'PUT', path: `users/${userId}/active`, data: {active}});
return cy.externalRequest({user: admin, method: 'PUT', path: `users/${userId}/active`, data: {active}});
}
Cypress.Commands.add('externalActivateUser', externalActivateUser);