test: verifica che fuoriRange non trunca il valore numerico
This commit is contained in:
@@ -41,8 +41,9 @@ describe('registrazione delle misure', () => {
|
||||
const s = apriSessione(db, { client_code: 'ISL-0001', data: '2026-08-21', tipo: 'questionario' });
|
||||
const esito = registraMisure(db, s, 'questionario', [{ test_id: 'q_ore_sonno', valore_num: 26 }]);
|
||||
expect(esito.fuoriRange).toEqual(['q_ore_sonno']);
|
||||
const row = db.prepare(`SELECT fuori_range FROM misure WHERE test_id = 'q_ore_sonno'`).get() as { fuori_range: number };
|
||||
const row = db.prepare(`SELECT valore_num, fuori_range FROM misure WHERE test_id = 'q_ore_sonno'`).get() as { valore_num: number; fuori_range: number };
|
||||
expect(row.fuori_range).toBe(1);
|
||||
expect(row.valore_num).toBe(26);
|
||||
});
|
||||
|
||||
it('la sessione porta la versione del questionario', () => {
|
||||
|
||||
Reference in New Issue
Block a user