수집한 객실·이용 정보가 발행 화면에 연결되지 않던 경로를 보완하고, 숙소 소개와 지역 맛집 표시를 개선한다. - NOL 브라우저 수집 어댑터와 수집·반영 스크립트 추가 - 크롤링 fact 즉시 노출 및 직접 입력·정정값 보호 - 이용안내 항목별 구조화와 기존 표 연결, 원문 UI 비표시 - 군산 한일옥 고정 등록과 지역 맛집 탐색·보강 경로 추가 - 숙소 소개 요약, 히어로 문구, 지역 콘텐츠·목업 표시 개선 검증: 작업 트리 기준 site 타입·린트·빌드 및 안내 렌더링 테스트 통과, PC·모바일 화면 확인. 스테이징 diff 공백 검사 통과. 사용자 요청에 따라 현재 스테이징된 55개 파일만 포함하며 미스테이징 문서·테스트 등은 제외.
46 lines
2.2 KiB
TypeScript
46 lines
2.2 KiB
TypeScript
import {expect, it} from 'vitest';
|
|
import {renderToStaticMarkup} from 'react-dom/server';
|
|
import {FactStatus, SourceType, type SitePayload} from '@o2o/shared';
|
|
import {SiteProvider} from '@site/lib/site-context';
|
|
import {MOONLIGHT_STAY_PAYLOAD} from '@site/fixtures/moonlight-stay';
|
|
import {AnswerBlock} from './AnswerBlock';
|
|
import {EssentialInfoSection} from './EssentialInfoSection';
|
|
import {AboutSection} from './AboutSection';
|
|
|
|
function fixture(summary?: string): SitePayload {
|
|
const payload = structuredClone(MOONLIGHT_STAY_PAYLOAD);
|
|
payload.facts = [{
|
|
key: 'intro', label: '숙소 소개', value: '숙소 소개 전체 원문입니다.', summary,
|
|
scope: 'place', type: 'text', status: FactStatus.VERIFIED,
|
|
sourceType: SourceType.LLM, critical: false, required: false,
|
|
}];
|
|
payload.narrative = {about: ['숙소 소개 전체 원문입니다.'], summary: '기존 첫 문장'};
|
|
return payload;
|
|
}
|
|
|
|
it('shows the same summary in both booking information sections', () => {
|
|
const payload = fixture('짧게 요약한 숙소 소개');
|
|
for (const section of [<AnswerBlock />, <EssentialInfoSection />]) {
|
|
const html = renderToStaticMarkup(<SiteProvider payload={payload}>{section}</SiteProvider>);
|
|
expect(html).toContain('짧게 요약한 숙소 소개');
|
|
expect(html).not.toContain('숙소 소개 전체 원문입니다.');
|
|
}
|
|
const about = renderToStaticMarkup(<SiteProvider payload={payload}><AboutSection /></SiteProvider>);
|
|
expect(about).toContain('숙소 소개 전체 원문입니다.');
|
|
});
|
|
|
|
it.each([undefined, ' '])('keeps original text when summary is %s', (summary) => {
|
|
const payload = fixture(summary);
|
|
const html = renderToStaticMarkup(<SiteProvider payload={payload}><EssentialInfoSection /></SiteProvider>);
|
|
expect(html).toContain('숙소 소개 전체 원문입니다.');
|
|
});
|
|
|
|
it('does not expose summaries from unverified facts', () => {
|
|
const payload = fixture('검증 안 된 요약');
|
|
payload.facts[0].status = FactStatus.UNVERIFIED;
|
|
for (const section of [<AnswerBlock />, <EssentialInfoSection />]) {
|
|
const html = renderToStaticMarkup(<SiteProvider payload={payload}>{section}</SiteProvider>);
|
|
expect(html).not.toContain('검증 안 된 요약');
|
|
}
|
|
});
|