import '../../../dist/zn.min.js'; import { expect, fixture } from '@open-wc/testing'; import type { LitElement } from 'lit'; const textSection = async (body: string) => { const el = await fixture( `
${body}
` ); await el.updateComplete; return el.shadowRoot!.querySelector('.text-content')!; }; describe('', () => { it('should render a component', async () => { const el = await fixture(''); expect(el).to.exist; }); it('should render markup in the text body as text', async () => { const content = await textSection('<img src="x" onerror="window.__xss = true"> hello'); expect(content.querySelector('img')).to.be.null; expect(content.textContent).to.contain(' hello'); expect((window as unknown as Record).__xss).to.be.undefined; }); it('should treat escaped breaks in the text body as line breaks', async () => { const content = await textSection('line1<br />line2'); expect(content.textContent).to.not.contain('