import { App } from '@inertiajs/react'; import { renderToStaticMarkup } from 'react-dom/server'; import { expect, test } from 'vitest'; import RequisitionForm from '@/pages/requisitions/form'; import { money, date } from '@/types/procurement'; test('incomplete draft restores the supplied line and missing amounts without inventing zero prices', () => { const html = renderToStaticMarkup( , ); expect(html).toContain('Preparação recuperada'); expect(html).toMatch(/novalidate=""/i); expect(html).toContain('Por completar'); expect(html).not.toContain('value="null"'); expect(html).not.toContain('value="0.00"'); }); test('unknown money and dates are distinguishable from a genuine zero value', () => { expect(money(null)).toBe('Por completar'); expect(date(null)).toBe('Por completar'); expect(money(0)).not.toBe('Por completar'); });