import { readFileSync } from 'node:fs'; import { describe, expect, it } from 'vitest'; describe('self-purchase total API', () => { it('registers GET /purchase-orders/self-purchase-total', () => { const src = readFileSync(new URL('../src/modules/workflow/routes/purchaseRoutes.ts', import.meta.url), 'utf8'); expect(src).toContain("router.get('/purchase-orders/self-purchase-total'"); expect(src).toContain('sumSelfPurchaseTotalAmount'); }); it('Web client calls the total endpoint', () => { const api = readFileSync(new URL('../../src/utils/workflowApi.ts', import.meta.url), 'utf8'); expect(api).toContain('/purchase-orders/self-purchase-total'); }); });