Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useAppNavigation } from '@mezon/core';
import type { CategoriesEntity, IUpdateChannelRequest } from '@mezon/store';
import { channelsActions, selectAllCategories, selectChannelById, useAppDispatch, useAppSelector } from '@mezon/store';
import { Icons, Menu } from '@mezon/ui';
import type { IChannel } from '@mezon/utils';
import { generateE2eId, type IChannel } from '@mezon/utils';
import type { ReactElement } from 'react';
import { useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
Expand Down Expand Up @@ -81,8 +81,11 @@ const SettingCategoryChannel = (props: CategoryChannelProps) => {
<p className="text-xs font-bold text-theme-primary mt-4">{t('categoryManagement.category')}</p>

<Menu menu={menu}>
<div className="w-full h-12 rounded-md border-theme-primary text-theme-message bg-input-secondary flex flex-row px-3 justify-between items-center uppercase">
<p>{categoryName}</p>
<div
className="w-full h-12 rounded-md border-theme-primary text-theme-message bg-input-secondary flex flex-row px-3 justify-between items-center uppercase"
data-e2e={generateE2eId('channel_setting_page.category.dropdown')}
>
<p data-e2e={generateE2eId('channel_setting_page.category.dropdown.value')}>{categoryName}</p>
<Icons.ArrowDownFill />
</div>
</Menu>
Expand Down
3 changes: 2 additions & 1 deletion libs/ui/src/lib/DropDown/Dropdown.Content.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { generateE2eId } from '@mezon/utils';
import { ReactNode } from 'react';

type MenuItemProps = {
Expand All @@ -7,7 +8,7 @@ type MenuItemProps = {
};
const Item = ({ children, onClick, className }: MenuItemProps) => {
return (
<div className={`rounded-lg p-2 ${className}`} onClick={onClick}>
<div className={`rounded-lg p-2 ${className}`} onClick={onClick} data-e2e={generateE2eId('dropdown.item')}>
{children}
</div>
);
Expand Down
9 changes: 9 additions & 0 deletions libs/utils/src/lib/e2e-testing/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export const DATA_E2E_IDENTIFIER = {
base: '',
copy: ''
},
dropdown: {
item: ''
},
base_profile: {
display_name: '',
user_status: ''
Expand Down Expand Up @@ -510,6 +513,12 @@ export const DATA_E2E_IDENTIFIER = {
type: '',
message_content: ''
}
},
category: {
channel_name: '',
dropdown: {
value: '',
}
}
},
chat: {
Expand Down