-
Notifications
You must be signed in to change notification settings - Fork 23
refactor: UI Component Refactoring - ChatMessageItem.razor #469
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: UI Component Refactoring - ChatMessageItem.razor #469
Conversation
…ntRefactoring-ChatMessageItem-razor
…on visibility test
…ntRefactoring-ChatMessageItem-razor
…ntRefactoring-ChatMessageItem-razor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
지금 WaitForFunctionAsync
를 쓰면서 JS 문자열이 많이 사용되고 있는데, Playwright를 쓰더라도 테스트 작성에 문제는 없는데요.
[Trait("Category", "IntegrationTest")]
[Theory]
[InlineData("Input usermessage")]
public async Task Given_UserMessage_When_Sent_Then_Rendered_Text_Should_Match_UserMessage(string userMessage)
{
// Arrange
var textArea = Page.GetByRole(AriaRole.Textbox, new() { Name = "User Message Textarea" });
var userMessages = Page.Locator(".user-message");
var initialCount = await userMessages.CountAsync();
// Act
await textArea.FillAsync(userMessage);
await textArea.PressAsync("Enter");
await userMessages.Nth(initialCount).WaitForAsync(new() { State = WaitForSelectorState.Attached });
// Assert
var latestUserMessage = userMessages.Nth(initialCount);
var renderedText = await latestUserMessage.InnerTextAsync();
renderedText.ShouldBe(userMessage);
}
예시로 이런 식으로도 할 수 있습니다.
기능적인 부분보다는 어떤 방식이 가독성이 더 낫고, 테스트 코드의 의도를 잘 드러내는지를 기준으로 판단 해보면 좋을 것 같은 데 어떻게 생각하시나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 파일은 왜 수정하신 거죠?
넵 이게 더 나은 것 같습니다 그런식으로 수정해보겠습니다! |
…ntRefactoring-ChatMessageItem-razor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다!
Purpose
ChatMessageItem.razor
#301Does this introduce a breaking change?
Pull Request Type
What kind of change does this Pull Request introduce?
README updated?
The top-level readme for this repo contains a link to each sample in the repo. If you're adding a new sample did you update the readme?
How to Test
What to Check
Verify that the following are valid
Other Information
입력 메세지(사용자의 userMessage)와 출력 메세지(ai의 assistantMessage)가 있을 때, 각각 비동기 렌더링 된 후의 메세지의 개수 증가, 텍스트 일치(혹은 빈 문자열 X)를 확인했습니다.