import { App } from '@inertiajs/react';
import type { Page } from '@inertiajs/core';
import { renderToString } from 'react-dom/server';
import { expect, test } from 'vitest';
import { ProcurementOperationalInsights } from '@/components/procurement-operational-insights';
import type { ProcurementInsights } from '@/components/procurement-operational-insights';
const base = {
component: 'reports/procurement',
url: '/relatorios',
version: 'insights',
props: { errors: {} },
clearHistory: false,
encryptHistory: true,
} satisfies Page;
test.each([0, 2])(
'procurement reading renders scope %i and source links with honest limitations',
(processes) => {
const data: ProcurementInsights = {
method: 'procurement_facts_v1',
generated_at: '2026-10-30T12:00:00Z',
processes,
pending: {
count: 1,
unknown_submission_age: 0,
oldest: [
{
id: 42,
number: 'REQ-42',
submitted_at: '2026-10-23T12:00:00Z',
days_since_submission: 7,
href: '/requisicoes/42/processo',
},
],
},
unapproved_past_needed_date: 1,
approved: {
count: 1,
without_registered_quotes: 0,
without_visible_order: 0,
},
};
function Screen() {
return