import test from 'node:test'; import assert from 'node:assert/strict'; import { publicBusinessOfflineHtml, downloadPublicBusinessOffline, } from '../../resources/js/lib/public-business-offline.ts'; const savedAt = new Date('2026-11-02T15:00:00.000Z'); const record = { slug: 'synthetic', title: 'Negócio sintético', modality: 'company_sale', amount_min: '9007199254740993.25', currency: 'MZN', province: 'Província sintética', payload: { private: 'RESERVED' }, owner_user_id: 73, }; await test('offline fiche is self-contained, preserves exact public values and identifies capture versus publication', () => { const html = publicBusinessOfflineHtml( record, 'Venda da empresa', 'https://portal.example.invalid', savedAt, ); assert.match(html, /9007199254740993\.25 MZN/); assert.match(html, /2026-11-02T15:00:00\.000Z/); assert.match(html, /Publicação no portal<\/dt>