dev(test): /test prefill 을 뷰성형외과 fixture 로 고정

- pickRandomIndex → pickIndex(PINNED_LABEL) 로 변경, 항상 뷰성형외과 선택.
- "다른 병원 랜덤" 버튼·seed state 제거 (의미 없어짐).
- CLINICS 의 나머지 9개 fixture 는 mockUrls.ts 에 그대로 보존.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
main
Mina Choi 2026-05-21 08:41:32 +09:00
parent da07bdc8c8
commit 68bb1d62cd
1 changed files with 9 additions and 14 deletions

View File

@ -5,19 +5,21 @@
* - "다른 병원 랜덤"
* - DevOnly localhost
*/
import { useMemo, useState } from 'react'
import { useNavigate } from 'react-router'
import MultiChannelInput, { type AnalyzePayload } from '@/features/channels/components/MultiChannelInput'
import { CLINICS } from '../fixtures/mockUrls'
function pickRandomIndex(): number {
return Math.floor(Math.random() * CLINICS.length)
// 현재는 뷰성형외과만 prefill 한다. CLINICS 의 다른 fixture 는 삭제하지 않고 보존.
const PINNED_LABEL = '뷰성형외과'
function pickIndex(): number {
const i = CLINICS.findIndex((c) => c.label === PINNED_LABEL)
return i >= 0 ? i : 0
}
export default function TestPrefillPage() {
const navigate = useNavigate()
const [seed, setSeed] = useState(0)
const index = useMemo(() => pickRandomIndex(), [seed])
const index = pickIndex()
const clinic = CLINICS[index]
const handleAnalyze = (payload: AnalyzePayload) => {
@ -45,18 +47,11 @@ export default function TestPrefillPage() {
{' '}<span className="text-slate-400">({index + 1} / {CLINICS.length})</span>
</p>
</div>
<button
type="button"
onClick={() => setSeed((s) => s + 1)}
className="px-4 py-2 rounded-lg bg-white border border-slate-200 text-sm font-medium text-slate-700 hover:bg-slate-50 shadow-sm"
>
</button>
{/* PINNED_LABEL .
pickIndex() randomize . */}
</div>
{/* key={seed} 로 강제 remount — initialUrls는 mount 시점 1회만 반영되기 때문 */}
<MultiChannelInput
key={seed}
variant="hero"
initialUrls={clinic.urls}
onAnalyze={handleAnalyze}