From 553551572e459e27fa6aadc9d259ac82c073b023 Mon Sep 17 00:00:00 2001 From: "trinh.truongthiphuong" Date: Tue, 23 Sep 2025 10:33:46 +0700 Subject: [PATCH 1/2] mark e2e to verify message is pinned --- .../PinnedMessages/ItemPinMessage.tsx | 9 ++++++-- .../lib/components/ChannelTopbar/index.tsx | 1 + .../components/MessageWithSystem/index.tsx | 8 +++++-- .../MessageWithUser/MessageLineSystem.tsx | 23 +++++++++++++------ libs/utils/src/lib/e2e-testing/constants.ts | 21 ++++++++++++++--- 5 files changed, 48 insertions(+), 14 deletions(-) diff --git a/libs/components/src/lib/components/ChannelTopbar/TopBarComponents/PinnedMessages/ItemPinMessage.tsx b/libs/components/src/lib/components/ChannelTopbar/TopBarComponents/PinnedMessages/ItemPinMessage.tsx index 35d97147d8..386c58a411 100644 --- a/libs/components/src/lib/components/ChannelTopbar/TopBarComponents/PinnedMessages/ItemPinMessage.tsx +++ b/libs/components/src/lib/components/ChannelTopbar/TopBarComponents/PinnedMessages/ItemPinMessage.tsx @@ -71,7 +71,7 @@ const ItemPinMessage = (props: ItemPinMessageProps) => { return (
@@ -118,10 +118,15 @@ const ItemPinMessage = (props: ItemPinMessageProps) => {
-
)} diff --git a/libs/components/src/lib/components/MessageWithSystem/index.tsx b/libs/components/src/lib/components/MessageWithSystem/index.tsx index ea7a523d68..a951659de8 100644 --- a/libs/components/src/lib/components/MessageWithSystem/index.tsx +++ b/libs/components/src/lib/components/MessageWithSystem/index.tsx @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-empty-function */ import type { MessagesEntity } from '@mezon/store'; import { Icons } from '@mezon/ui'; -import { TypeMessage, addMention, convertDateStringI18n } from '@mezon/utils'; +import { TypeMessage, addMention, convertDateStringI18n, generateE2eId } from '@mezon/utils'; import type { ReactNode } from 'react'; import React, { useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -46,7 +46,10 @@ function MessageWithSystem({ messageId={message?.id} className={'fullBoxText relative group'} > -
+
{message?.code === TypeMessage.Welcome && } {message?.code === TypeMessage.UpcomingEvent && } {message?.code === TypeMessage.CreateThread && } @@ -117,6 +120,7 @@ const HoverStateWrapper: React.FC = ({ }; return (
- {translateMessage('systemMessages.pinned')}{' '} - - {translateMessage('systemMessages.aMessage')} + pinned{' '} + + a message {' '} - {translateMessage('systemMessages.toThisChannel')}{' '} - - {translateMessage('systemMessages.allPinned')} + to this channel. See{' '} + + all pinned {' '} {translateMessage('systemMessages.messages')} diff --git a/libs/utils/src/lib/e2e-testing/constants.ts b/libs/utils/src/lib/e2e-testing/constants.ts index 9859d097f6..c5d9c0f4f9 100644 --- a/libs/utils/src/lib/e2e-testing/constants.ts +++ b/libs/utils/src/lib/e2e-testing/constants.ts @@ -297,7 +297,9 @@ export const DATA_E2E_IDENTIFIER = { file: '', mute: '', inbox: '', - pin: '', + pin: { + pin_badge: '' + }, canvas: '', thread: { modal: { @@ -352,7 +354,15 @@ export const DATA_E2E_IDENTIFIER = { } } }, - suggest_item: '' + suggest_item: '', + system_message: { + pin_message: { + button: { + jump_to_message: '', + see_all_pinned: '' + } + } + } }, onboarding: { chat: { @@ -405,7 +415,12 @@ export const DATA_E2E_IDENTIFIER = { item_pin_message: { username: '' }, - pin_message: '' + pin_message: { + button: { + jump: '', + remove_pin: '' + } + } }, modal: { too_many_upload: '', From 56898c4e6522c19456f07fff79407c44424b1fd2 Mon Sep 17 00:00:00 2001 From: "trinh.truongthiphuong" Date: Tue, 23 Sep 2025 10:49:33 +0700 Subject: [PATCH 2/2] resolve conflict --- .../TopBarComponents/PinnedMessages/ItemPinMessage.tsx | 6 +++--- .../src/lib/components/MessageWithSystem/index.tsx | 4 ++-- .../components/MessageWithUser/MessageLineSystem.tsx | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libs/components/src/lib/components/ChannelTopbar/TopBarComponents/PinnedMessages/ItemPinMessage.tsx b/libs/components/src/lib/components/ChannelTopbar/TopBarComponents/PinnedMessages/ItemPinMessage.tsx index 386c58a411..ce9ebacbbf 100644 --- a/libs/components/src/lib/components/ChannelTopbar/TopBarComponents/PinnedMessages/ItemPinMessage.tsx +++ b/libs/components/src/lib/components/ChannelTopbar/TopBarComponents/PinnedMessages/ItemPinMessage.tsx @@ -71,8 +71,8 @@ const ItemPinMessage = (props: ItemPinMessageProps) => { return (
@@ -119,16 +119,16 @@ const ItemPinMessage = (props: ItemPinMessageProps) => {
diff --git a/libs/components/src/lib/components/MessageWithSystem/index.tsx b/libs/components/src/lib/components/MessageWithSystem/index.tsx index a951659de8..7c4c91faa1 100644 --- a/libs/components/src/lib/components/MessageWithSystem/index.tsx +++ b/libs/components/src/lib/components/MessageWithSystem/index.tsx @@ -47,8 +47,8 @@ function MessageWithSystem({ className={'fullBoxText relative group'} >
{message?.code === TypeMessage.Welcome && } {message?.code === TypeMessage.UpcomingEvent && } @@ -120,12 +120,12 @@ const HoverStateWrapper: React.FC = ({ }; return (
{children} {isHover && popup && popup()} diff --git a/libs/components/src/lib/components/MessageWithUser/MessageLineSystem.tsx b/libs/components/src/lib/components/MessageWithUser/MessageLineSystem.tsx index 8f80848a07..51f9c1bc4d 100644 --- a/libs/components/src/lib/components/MessageWithUser/MessageLineSystem.tsx +++ b/libs/components/src/lib/components/MessageWithUser/MessageLineSystem.tsx @@ -148,21 +148,21 @@ const RenderContentSystem = ({ message, data, mode, isSearchMessage, isJumMessag {content}{' '} {message.code === TypeMessage.CreatePin && ( <> - pinned{' '} + {translateMessage('systemMessages.pinned')}{' '} - a message + {translateMessage('systemMessages.aMessage')} {' '} - to this channel. See{' '} + {translateMessage('systemMessages.toThisChannel')}{' '} - all pinned + {translateMessage('systemMessages.allPinned')} {' '} {translateMessage('systemMessages.messages')}