diff --git a/src/pages/stock/Stock.css b/src/pages/stock/Stock.css index 35c4686..88f6944 100644 --- a/src/pages/stock/Stock.css +++ b/src/pages/stock/Stock.css @@ -3349,4 +3349,5 @@ } .wl-cond { font-size: 13px; font-weight: 600; } .wl-alert__price { font-size: 13px; color: var(--muted); } +.wl-alert__reason { font-size: 12.5px; line-height: 1.45; color: #cbd5e1; } .wl-alert__detail { font-size: 12px; color: var(--muted); } diff --git a/src/pages/stock/components/WatchlistTab.jsx b/src/pages/stock/components/WatchlistTab.jsx index e762597..aaf496c 100644 --- a/src/pages/stock/components/WatchlistTab.jsx +++ b/src/pages/stock/components/WatchlistTab.jsx @@ -24,6 +24,7 @@ const AlertCard = ({ a }) => { {conditionLabel(a.condition)} {a.price != null && {formatNumber(a.price)}원} + {a.reason &&
{a.reason}
} {detailText &&
{detailText}
} ); diff --git a/src/pages/stock/components/WatchlistTab.test.jsx b/src/pages/stock/components/WatchlistTab.test.jsx index a99ddf3..efc2d93 100644 --- a/src/pages/stock/components/WatchlistTab.test.jsx +++ b/src/pages/stock/components/WatchlistTab.test.jsx @@ -44,4 +44,19 @@ describe('WatchlistTab', () => { // 객체 detail이 문자열로 안전 렌더됨 (severity 값 노출) expect(screen.getByText(/normal/)).toBeInTheDocument(); }); + + it('alert.reason(근거 문자열)을 condition 라벨과 함께 렌더', () => { + const wl = { + ...baseWl, + alerts: [{ + id: 40, ticker: '000660', name: 'SK하이닉스', kind: 'sell', condition: 'sell_ma_break', + price: 2120000, detail: { ma50: 2123160, ma200: null, severity: 'normal' }, + fired_at: '2026-07-09T02:55:00Z', + reason: '주요 이평선(MA50/200) 이탈 — 추세 훼손, 보유 재검토', + }], + }; + render(); + expect(screen.getByText('주요 이평선(MA50/200) 이탈 — 추세 훼손, 보유 재검토')).toBeInTheDocument(); + expect(screen.getByText('이평선 이탈')).toBeInTheDocument(); + }); });