import { describe, it, expect } from 'vitest'; import { normalizeHtml } from './normalize.ts'; import { diffStruct } from './diff.ts'; describe('structural diff', () => { it('ignores class/style/whitespace changes (the de-Tailwind case)', () => { const live = `
`; const next = ``; expect(diffStruct(normalizeHtml(live), normalizeHtml(next))).toEqual([]); }); it('flags a changed href (real content/structure change)', () => { const live = `Hi`; const next = `Hi`; const d = diffStruct(normalizeHtml(live), normalizeHtml(next)); expect(d).toHaveLength(1); expect(d[0].kind).toBe('attr'); }); it('flags changed text and missing nodes', () => { const live = `