Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Add testid to the components in Channel #1089

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

HoonBaek
Copy link
Collaborator

@HoonBaek HoonBaek commented May 10, 2024

Added data-testid to the UI components for making it easily to select them in the QE test

@HoonBaek HoonBaek self-assigned this May 10, 2024
Copy link

netlify bot commented May 10, 2024

Deploy Preview for sendbird-uikit-react ready!

Name Link
🔨 Latest commit 8bd113d
🔍 Latest deploy log https://app.netlify.com/sites/sendbird-uikit-react/deploys/6642e8f0ecd86600084e1bae
😎 Deploy Preview https://deploy-preview-1089--sendbird-uikit-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@HoonBaek HoonBaek force-pushed the refactor/CLNP-2666/Add-testid-to-channel-components branch from f152fac to c5e31c2 Compare May 10, 2024 07:32
@HoonBaek HoonBaek requested a review from bang9 May 14, 2024 04:30
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data-sb-id 제거해도 괜찮지 않을까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

혹시라도 기존에 사용하고 있던 고객이 있다면 문제가 생길 수 있지 않을까 싶어서 삭제하지 않았습니다
ref: https://sendbird.atlassian.net/browse/SBISSUE-15260

Copy link
Contributor

@bang9 bang9 May 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

흠 저런게 있군요, 그럼 deprecated 마크 해놓고 넘어가시죠!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deprecation 한 뒤에 가능하면, <MenuItem dataSbId={...} /> 로 작성된 코드들도
내부에서는 <MenuItem testID={...} /> 사용하도록 바뀌면 좋을것 같습니다.

@HoonBaek HoonBaek requested a review from bang9 May 14, 2024 06:37
])}
isAnimated && 'sendbird-msg-hoc__animated',
)}
data-testid="sendbird-message-hoc"
Copy link
Contributor

@bang9 bang9 May 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 새롭게 무언가를 추가할때는, 기존것을 그냥 따라가는것도 유지보수에 좋기는 하지만
기존에서 개선할 부분이 있는지에 대한 부분 또한 고려되면 좋은데요 (레거시를 탈피할 좋은 기회)

hoc 가 고차 컴포넌트를 의미하는 단어로 사용되었던게 맞을까요?
만약 그렇다면, 현재 컴포넌트의 위치에 사용하기 적합한 단어인지를 고려해보면 좋을 것 같습니다.

@@ -69,7 +69,7 @@ type MessageInputProps = {
channel: GroupChannel | OpenChannel;
message?: UserMessage;
value?: null | string;
className?: string | string[];
className?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요거 고객쪽에 깨지는거 없을까용?

@@ -53,6 +53,7 @@ const ReactionButton = React.forwardRef((props: ReactionButtonProps, ref: Forwar
{...onClickHandler}
tabIndex={0}
data-sb-id={dataSbId}
data-testid={dataSbId}
Copy link
Contributor

@bang9 bang9 May 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 이건 기존에 사용하고있는 dataSbId 가 좀 많아서 이해는 되는 부분인데, 아래의 관점에서 좋은 선택일지 나중에 고민해보시면 좋을것 같아서 코멘트 남깁니다.

  • 작성된 testID 와 dataSbId 의 컨벤션 문제 (히스토리를 모르는 개발자가, 나중에 코드를 보았을때 추측을 하게되는 코드는 좋지 않다. ex: 여긴 왜 다른데랑 다른형식으로 작성이 되어있지?)
  • 새롭게 추가되는 인터페이스에, 앞으로 제거할 레거시를 이어가는것이 좋은 선택인지 (ex: 여러번의 메이저 버전을 넘어오는 과정에서 이러한 선택이 없었는지, 있었다면 다음 메이저 버전에서 개선을 했었는지, 개선을 했다면 어떤 방식으로 이 태스크를 챙겼는지 등.. 과거에서 되돌아 볼 수 있음)

@bang9
Copy link
Contributor

bang9 commented May 14, 2024

Do you have a ticket for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants