MM-47288 refactor: convert channels/channel/ files to ts (#28483)

* refactor: convert channels/channel/ files to ts

- convert js files to typescript
- update types
- fix lint issues

Fixes: 21299

* fix: solve lint issues channels/channel

- fix lint issues
- udpate types

* fix: adjustment to test case MM-T1687

- code reorganization for test case MM-T1687

* fix: update types on function apiCreateCustomAdmin

- update types for apiCreateCustomAdmin on  user.d.ts so that
lint issue is solved
Этот коммит содержится в:
Angel Mendez
2024-10-09 05:22:45 -06:00
коммит произвёл GitHub
родитель 429c41747c
Коммит 23623fc9c9
22 изменённых файлов: 168 добавлений и 103 удалений

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

@@ -0,0 +1,38 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {ChainableT} from 'tests/types';
function uiSearchPosts(searchTerm: string) {
// # Enter the search terms and hit enter to start the search
cy.get('#searchBox').clear().type(searchTerm).type('{enter}');
// * Wait for the RHS to open and the search results to appear
cy.contains('.sidebar--right__header', 'Search Results').should('be.visible');
cy.get('#searchContainer .LoadingSpinner').should('not.exist');
}
Cypress.Commands.add('uiSearchPosts', uiSearchPosts);
function uiJumpToSearchResult(postId: string) {
// # Find the post in the search results and click Jump
cy.get(`#searchResult_${postId}`).contains('a', 'Jump').click();
// * Verify the URL changes to the permalink URL
cy.url().should((url) => url.endsWith(`/${postId}`));
// * Verify that the permalinked post is highlighted in the center channel
cy.get(`#post_${postId}.post--highlight`).should('be.visible');
}
Cypress.Commands.add('uiJumpToSearchResult', uiJumpToSearchResult);
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace Cypress {
interface Chainable {
uiSearchPosts(searchTerm: string): ChainableT;
uiJumpToSearchResult(postId: string): ChainableT;
}
}
}