Files
o2o-site-AEO/solution/site/src/sections/hero-catchphrase.test.tsx
T
skkim a093921b62 feat(backend,site): NOL 수집 및 숙박 안내 구조화와 지역 콘텐츠 연동
수집한 객실·이용 정보가 발행 화면에 연결되지 않던 경로를 보완하고, 숙소 소개와 지역 맛집 표시를 개선한다.

- NOL 브라우저 수집 어댑터와 수집·반영 스크립트 추가
- 크롤링 fact 즉시 노출 및 직접 입력·정정값 보호
- 이용안내 항목별 구조화와 기존 표 연결, 원문 UI 비표시
- 군산 한일옥 고정 등록과 지역 맛집 탐색·보강 경로 추가
- 숙소 소개 요약, 히어로 문구, 지역 콘텐츠·목업 표시 개선

검증: 작업 트리 기준 site 타입·린트·빌드 및 안내 렌더링 테스트 통과, PC·모바일 화면 확인. 스테이징 diff 공백 검사 통과. 사용자 요청에 따라 현재 스테이징된 55개 파일만 포함하며 미스테이징 문서·테스트 등은 제외.
2026-09-14 19:40:04 +09:00

28 lines
1.3 KiB
TypeScript

import {expect, it} from 'vitest';
import {renderToStaticMarkup} from 'react-dom/server';
import {PlaceCategory} from '@o2o/shared';
import {SiteProvider} from '@site/lib/site-context';
import {MOONLIGHT_STAY_PAYLOAD} from '@site/fixtures/moonlight-stay';
import lines from '@site/lib/lodging-catchphrases.json';
import {HeroCatchphrase} from './HeroCatchphrase';
it('keeps the original lodging tagline in the static HTML', () => {
const html = renderToStaticMarkup(<SiteProvider payload={MOONLIGHT_STAY_PAYLOAD}><HeroCatchphrase>고유문구</HeroCatchphrase></SiteProvider>);
expect(html).toContain('<span class="hero-catchphrase-fixed">고유문구</span>');
expect(html).toContain('w4d-line--in');
const text = html.replace(/<[^>]+>/g, '');
expect(text).toContain('고유문구' + lines[0]);
});
it('does not add lodging copy or controls to another category', () => {
const payload = structuredClone(MOONLIGHT_STAY_PAYLOAD);
payload.place.category = PlaceCategory.CAFE;
const html = renderToStaticMarkup(<SiteProvider payload={payload}><HeroCatchphrase>카페 소개</HeroCatchphrase></SiteProvider>);
expect(html).toBe('카페 소개');
});
it('ships ten distinct short phrases', () => {
expect(new Set(lines).size).toBe(10);
expect(lines.every((line) => line.length >= 15 && line.length <= 30)).toBe(true);
});