refactoring

This commit is contained in:
frankknoll
2023-11-10 13:16:54 +01:00
parent 4046d09c0b
commit ab16d68f0f
5 changed files with 11 additions and 10 deletions

View File

@@ -0,0 +1,30 @@
QUnit.module('PrrByKey2CsvConverterTest', function () {
QUnit.test('convertPrrByKey2Csv', function (assert) {
// Given
const prrByKey = {
"MM,R": 26.17432376240791,
"VARCEL": 10.549534724816644
};
// When
const csv = PrrByKey2CsvConverter.convertPrrByKey2Csv(
{
heading: '# Symptom: Acute hepatitis C',
columns: {
keyColumn: 'Vaccine',
prrColumn: 'Proportional Reporting Ratio'
},
prrByKey: prrByKey
});
// Then
const csvExpected =
`# Symptom: Acute hepatitis C
"Vaccine","Proportional Reporting Ratio"
"MM,R",26.17432376240791
"VARCEL",10.549534724816644`;
assert.equal(csv, csvExpected);
});
});