import { paragrapheCoverage } from '../src/services/qualimetrie/fullAgent'; describe('paragrapheCoverage utility', () => { it('should indicate NEED WORK for all low metrics', () => { const p = paragrapheCoverage(10, 20, 30, 40); expect(p).toMatch(/IL Y A DU TRAVAIL/); }); it('should indicate PEUT MIEUX FAIRE for metrics in 50-69%', () => { const p = paragrapheCoverage(55, 60, 65, 70); expect(p).toMatch(/PEUT MIEUX FAIRE/); }); it('should indicate PRESQUE CONFORME for metrics in 70-79%', () => { const p = paragrapheCoverage(70, 75, 78, 79); expect(p).toMatch(/PRESQUE CONFORME/); }); it('should indicate OK for metrics >= standard', () => { const p = paragrapheCoverage(80, 85, 90, 95); expect(p).toMatch(/OK/); }); it('should mention the weakest metric and its percentage', () => { const p = paragrapheCoverage(80, 85, 70, 90); expect(p).toContain('par branches est actuellement la plus basse avec 70 %'); }); });