fix: web app user avatar display incorrect black (#34624)

This commit is contained in:
非法操作 2026-04-07 11:23:56 +08:00 committed by GitHub
parent a7b6307d32
commit 2f9667de76
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 2 deletions

View File

@ -501,6 +501,16 @@ describe('Question component', () => {
expect(onRegenerate).toHaveBeenCalled()
})
it('should render default question avatar icon when questionIcon is not provided', () => {
const { container } = renderWithProvider(
makeItem(),
vi.fn() as unknown as OnRegenerate,
)
const defaultIcon = container.querySelector('.question-default-user-icon')
expect(defaultIcon).toBeInTheDocument()
})
it('should render custom questionIcon when provided', () => {
const { container } = renderWithProvider(
makeItem(),
@ -509,7 +519,7 @@ describe('Question component', () => {
)
expect(screen.getByTestId('custom-question-icon')).toBeInTheDocument()
const defaultIcon = container.querySelector('.i-custom-public-avatar-user')
const defaultIcon = container.querySelector('.question-default-user-icon')
expect(defaultIcon).not.toBeInTheDocument()
})

View File

@ -15,6 +15,7 @@ import {
import { useTranslation } from 'react-i18next'
import Textarea from 'react-textarea-autosize'
import { FileList } from '@/app/components/base/file-uploader'
import { User } from '@/app/components/base/icons/src/public/avatar'
import { Markdown } from '@/app/components/base/markdown'
import { cn } from '@/utils/classnames'
import ActionButton from '../../action-button'
@ -243,7 +244,7 @@ const Question: FC<QuestionProps> = ({
{
questionIcon || (
<div className="h-full w-full rounded-full border-[0.5px] border-black/5">
<div className="i-custom-public-avatar-user h-full w-full" />
<User className="question-default-user-icon h-full w-full" />
</div>
)
}