import { describe, expect, it } from 'vitest' import { XMLValidator } from 'fast-xml-parser' import { mapTrialBalancesToK2 } from '../k2-mapper' import { generateK2IxbrlDocument, embedKontrollsumma } from '../document/k2-document' import { makeInput, CURRENT } from './fixtures' describe('generateK2IxbrlDocument', () => { const { xhtml, warnings } = generateK2IxbrlDocument(makeInput()) it('produces well-formed XML (XHTML)', () => { const validation = XMLValidator.validate(xhtml) expect(validation).toBe(true) }) it('declares the container per TA §3/§4: UTF-8, title, programvara meta, no scripts', () => { expect(xhtml.startsWith('')).toBe(true) expect(xhtml).toContain('