import { describe, test, expect } from 'vitest'; import { purifyHtml } from './HtmlBlock'; import { stableHash } from '../../utils/escape'; import fixtureHtml from './__fixtures__/html-block-test-body.html?raw'; // Ground truth "before" output: purifyHtml(fixtureHtml) computed with the // EXACT HtmlBlock.tsx code as it stood at commit 6a9b227 (the commit // immediately before Task 25 -- `git show // 6a9b227:craft/src/components/basic/HtmlBlock.tsx`), run against the real // dompurify+jsdom, not guessed at or re-derived from reading the code. See // the "byte-diff against 6a9b227" describe block below -- this is the // literal regression check the Task 25 review asked for, after the first // round of `.not.toContain(...)`-style tests passed while FORCE_BODY was // silently changing output for a comment-led, style-free fixture. import preTask25FixtureOutput from './__fixtures__/html-block-test-body.pre-task25-output.html?raw'; describe('purifyHtml', () => { test('strips script tags', () => { expect(purifyHtml('
ok
')).not.toContain(''); expect(out).toContain('