import type { FC } from 'react' import { fireEvent, render, screen } from '@testing-library/react' import { beforeEach, describe, expect, it, vi } from 'vitest' import { CommentInput } from './comment-input' type MentionInputProps = { value: string onChange: (value: string) => void onSubmit: (content: string, mentionedUserIds: string[]) => void placeholder?: string autoFocus?: boolean disabled?: boolean className?: string } const stableT = (key: string, options?: { ns?: string }) => ( options?.ns ? `${options.ns}.${key}` : key ) let mentionInputProps: MentionInputProps | null = null vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: stableT, }), })) vi.mock('@/context/app-context', () => ({ useAppContext: () => ({ userProfile: { id: 'user-1', name: 'Alice', avatar_url: 'avatar', }, }), })) vi.mock('@/app/components/base/avatar', () => ({ default: ({ name }: { name: string }) =>