refactoring
This commit is contained in:
25
test/SymptomsCausedByVaccines/PrrByKey2CsvConverterTest.js
Normal file
25
test/SymptomsCausedByVaccines/PrrByKey2CsvConverterTest.js
Normal file
@@ -0,0 +1,25 @@
|
||||
QUnit.module('PrrByKey2CsvConverterTest', function () {
|
||||
|
||||
QUnit.test('convertPrrByKey2Csv', function (assert) {
|
||||
// Given
|
||||
const prrByKey = {
|
||||
"MM,R": 26.17432376240791,
|
||||
"VARCEL": 10.549534724816644
|
||||
};
|
||||
|
||||
// When
|
||||
const csv = PrrByKey2CsvConverter.convertPrrByKey2Csv(
|
||||
{
|
||||
prrByKey: prrByKey,
|
||||
keyColumn: 'Vaccine',
|
||||
prrColumn: 'Proportional Reporting Ratio'
|
||||
});
|
||||
|
||||
// Then
|
||||
const csvExpected =
|
||||
`"Vaccine","Proportional Reporting Ratio"
|
||||
"MM,R",26.17432376240791
|
||||
"VARCEL",10.549534724816644`;
|
||||
assert.equal(csv, csvExpected);
|
||||
});
|
||||
});
|
||||
@@ -1,16 +0,0 @@
|
||||
QUnit.module('UtilsTest', function () {
|
||||
|
||||
QUnit.test('convertDict2CSV', function (assert) {
|
||||
// Given
|
||||
const dict = {
|
||||
"MM,R": 26.17432376240791,
|
||||
"VARCEL": 10.549534724816644
|
||||
};
|
||||
|
||||
// When
|
||||
const csv = Utils.convertDict2CSV(dict);
|
||||
|
||||
// Then
|
||||
assert.equal(csv, '"MM,R","VARCEL"\n26.17432376240791,10.549534724816644');
|
||||
});
|
||||
});
|
||||
@@ -9,9 +9,9 @@
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
||||
<title>Symptoms caused by Vaccines</title>
|
||||
<script src="../../docs/Utils.js"></script>
|
||||
<script src="../../docs/Dict2CsvConverter.js"></script>
|
||||
<script src="../../docs/UIUtils.js"></script>
|
||||
<script src="../../docs/NumberWithBarElementFactory.js"></script>
|
||||
<script src="../../docs/SymptomsCausedByVaccines/js/PrrByKey2CsvConverter.js"></script>
|
||||
<script src="../../docs/SymptomsCausedByVaccines/js/PageInitializer.js"></script>
|
||||
<script src="../../docs/SymptomsCausedByVaccines/js/PrrByVaccineProvider.js"></script>
|
||||
<script src="../../docs/SymptomsCausedByVaccines/js/PrrByVaccineTable.js"></script>
|
||||
@@ -26,7 +26,7 @@
|
||||
JsHamcrest.Integration.QUnit();
|
||||
JsMockito.Integration.QUnit();
|
||||
</script>
|
||||
<script src="./UtilsTest.js"></script>
|
||||
<script src="./PrrByKey2CsvConverterTest.js"></script>
|
||||
</head>
|
||||
|
||||
<body class="nav-md">
|
||||
|
||||
Reference in New Issue
Block a user