import { describe, test, expect } from 'vitest'; import { BookingEmbed, bookingEmbedUrl } from './BookingEmbed'; const toHtml = (BookingEmbed as any).toHtml; const defaults = () => ({ ...(BookingEmbed as any).craft.props }); const run = (url: string, extra: any = {}) => toHtml({ ...defaults(), url, ...extra }, '').html as string; describe('BookingEmbed.toHtml host allowlist', () => { test.each([ 'https://calendly.com/acme/30min', 'https://app.calendly.com/x', 'https://squareup.com/appointments/book/abc', 'https://app.squareup.com/appointments/book/abc/L1/start', 'https://acme.square.site/appointments', ])('allows %s', (u) => { const html = run(u); expect(html).toContain('