mirror of
https://github.com/hanzoai/team.git
synced 2026-11-01 07:55:31 +00:00
* MM-69003 Switch to using @stylistic/eslint-plugin for deprecated ESLint rules * Run --fix on all web app packages These changes are mostly around TypeScript linting where the @stylistic versions are more accurate and therefore stricter about spacing and semicolons in TS types. * Run --fix on Cypress tests
40 lines
1.5 KiB
TypeScript
40 lines
1.5 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import * as TIMEOUTS from '@/fixtures/timeouts';
|
|
|
|
type ClickCategoryMenuItemProps = {
|
|
categoryDisplayName: string;
|
|
menuItemText: string;
|
|
categoryMenuButtonName?: string;
|
|
isSubMenu?: boolean;
|
|
};
|
|
|
|
export function clickCategoryMenuItem({categoryDisplayName, menuItemText, categoryMenuButtonName = categoryDisplayName, isSubMenu = false}: ClickCategoryMenuItemProps) {
|
|
cy.get('#SidebarContainer').should('be.visible').within(() => {
|
|
cy.findByText(categoryDisplayName).should('exist').parents('.SidebarChannelGroupHeader').within(() => {
|
|
cy.findByLabelText(`${categoryMenuButtonName} category options`).should('exist').click({force: true});
|
|
});
|
|
});
|
|
|
|
cy.wait(TIMEOUTS.HALF_SEC);
|
|
|
|
cy.findByRole('menu', {name: 'Edit category menu'}).should('be.visible').within(() => {
|
|
if (isSubMenu) {
|
|
cy.findByText(menuItemText).should('exist').trigger('mouseover', {force: true});
|
|
} else {
|
|
cy.findByText(menuItemText).should('exist').click({force: true});
|
|
}
|
|
});
|
|
}
|
|
|
|
export function clickSortCategoryMenuItem(categoryDisplayName: string, menuItemText: string) {
|
|
clickCategoryMenuItem({categoryDisplayName, menuItemText: 'Sort', isSubMenu: true});
|
|
|
|
cy.wait(TIMEOUTS.HALF_SEC);
|
|
|
|
cy.findAllByRole('menu', {name: 'Sort submenu'}).should('be.visible').within(() => {
|
|
cy.findByText(menuItemText).should('exist').click({force: true});
|
|
});
|
|
}
|