Unit tests for bilirubin pretty printing

This commit is contained in:
RunasSudo 2024-08-27 17:44:14 +10:00
parent af54b53fd2
commit 4b13e48e9f
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -74,3 +74,18 @@ suite('Days and hours display', () => {
}
});
});
suite('Bilirubin display', () => {
test('< 10 micromol/L', () => {
assert.equal(prettyPrintBilirubin(0), '0.0');
assert.equal(prettyPrintBilirubin(0.420), '0.4');
assert.equal(prettyPrintBilirubin(3.1415), '3.1');
assert.equal(prettyPrintBilirubin(3.99), '4.0');
});
test('>= 10 micromol/L', () => {
assert.equal(prettyPrintBilirubin(42), '42');
assert.equal(prettyPrintBilirubin(90.210), '90');
assert.equal(prettyPrintBilirubin(90.99), '91');
});
});