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(고유문구); expect(html).toContain('고유문구'); 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(카페 소개); 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); });