-
Notifications
You must be signed in to change notification settings - Fork 23
feat: UI Component Refactoring: ChatMessageList.razor #272 #495
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
base: main
Are you sure you want to change the base?
feat: UI Component Refactoring: ChatMessageList.razor #272 #495
Conversation
public partial class ChatMessageList : ComponentBase | ||
{ | ||
[Inject] | ||
private IJSRuntime JS { get; set; } = default!; |
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.
- 여기도
public
으로 바꿔 주세요. public IJSRuntime? JS { get; set; }
으로만 하면 어떤가요?
{ | ||
if (firstRender) | ||
{ | ||
await JS.InvokeVoidAsync("import", "./Components/Pages/Chat/ChatMessageList.razor.js"); |
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.
그러면 여기를 JS!.InvokeVoidAsync(...)
로 바꾸면 될 듯?
// Act - Check initial state before any user interaction | ||
var chatMessages = Page.Locator("chat-messages"); | ||
var inProgressAttribute = await chatMessages.GetAttributeAsync("in-progress"); | ||
|
||
// Assert - Initially no InProgressMessage, so attribute should be null |
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.
여기서 보면 // Act
뒤에, // Assert
뒤에 설명이 붙어 있는데, 이 설명이 없으면 이 테스트 메소드가 설명이 안 되는 건가요? 만약 그렇다면 테스트 메소드 이름에 저 설명을 녹여보면 어떨까요?
// Verify container structure remains intact | ||
var containerExists = await messageContainer.IsVisibleAsync(); | ||
var inputValue = await textArea.InputValueAsync(); | ||
|
||
// Assert - Verify ChatMessageList container is functional and input works |
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.
여기도 마찬가지
// Act - Test the empty state rendering of ChatMessageList | ||
if (expectedElement == "To get started, try asking about anything.") | ||
{ | ||
var noMessagesElement = Page.Locator(".no-messages"); | ||
var isVisible = await noMessagesElement.IsVisibleAsync(); | ||
var content = await noMessagesElement.InnerTextAsync(); | ||
|
||
// Assert - Verify NoMessagesContent is properly rendered | ||
isVisible.ShouldBeTrue(); | ||
content.ShouldContain(expectedElement); | ||
} | ||
else if (expectedElement == "User Message Textarea") | ||
{ | ||
// Test input field exists | ||
var textArea = Page.GetByRole(AriaRole.Textbox, new() { Name = expectedElement }); | ||
var inputExists = await textArea.IsVisibleAsync(); | ||
inputExists.ShouldBeTrue(); | ||
} |
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.
전에도 말했지만, 테스트 메소드 안에 if ... else
구문이 있으면 테스트 코드를 잘 못 짠 것입니다. 각각의 조건에 맞춰서 테스트 메소드를 새로 만드세요.
Resolve #272
Purpose
ChatMessageList.razor
#272Does 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