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
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
429c41747c
Коммит
23623fc9c9
@@ -1,16 +1,20 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
Cypress.Commands.add('uiSearchPosts', (searchTerm) => {
|
||||
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('uiJumpToSearchResult', (postId) => {
|
||||
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();
|
||||
|
||||
@@ -19,4 +23,16 @@ Cypress.Commands.add('uiJumpToSearchResult', (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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Ссылка в новой задаче
Block a user