adding ScatterChart2CsvConverterTest
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
QUnit.module('ScatterChart2CsvConverterTest', function () {
|
||||
|
||||
QUnit.test('convertScatterChart2Csv', function (assert) {
|
||||
// Given
|
||||
const scatterChartDescr = {
|
||||
symptomX: 'Adult failure to thrive',
|
||||
symptomY: 'Acariasis',
|
||||
batches: ['002A21A', '002A21B'],
|
||||
data: [
|
||||
{
|
||||
x: 2.1,
|
||||
y: 3.1
|
||||
},
|
||||
{
|
||||
x: 4.1,
|
||||
y: 5.1
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
// When
|
||||
const csv = ScatterChart2CsvConverter.convertScatterChart2Csv(scatterChartDescr);
|
||||
|
||||
// Then
|
||||
const csvExpected =
|
||||
`"Batch","PRR ratio of Batch for Adult failure to thrive","PRR ratio of Batch for Acariasis"
|
||||
"002A21A",2.1,3.1
|
||||
"002A21B",4.1,5.1`;
|
||||
assert.equal(csv, csvExpected);
|
||||
});
|
||||
});
|
||||
@@ -3,12 +3,12 @@ QUnit.module('SymptomVsSymptomChartDataProviderTest', function () {
|
||||
QUnit.test('shouldProvideChartData', function (assert) {
|
||||
// Given
|
||||
const prrByLotX = {
|
||||
"lotX": 1.0,
|
||||
"lotCommon": 2.0
|
||||
'lotX': 1.0,
|
||||
'lotCommon': 2.0
|
||||
};
|
||||
const prrByLotY = {
|
||||
"lotCommon": 3.0,
|
||||
"lotY": 4.0
|
||||
'lotCommon': 3.0,
|
||||
'lotY': 4.0
|
||||
};
|
||||
|
||||
// When
|
||||
@@ -18,7 +18,7 @@ QUnit.module('SymptomVsSymptomChartDataProviderTest', function () {
|
||||
assert.deepEqual(
|
||||
chartData,
|
||||
{
|
||||
labels: ["lotCommon"],
|
||||
labels: ['lotCommon'],
|
||||
data: [
|
||||
{
|
||||
x: 2.0,
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<script src="../js/SymptomVsSymptomChartDataProvider.js"></script>
|
||||
<script src="../js/SymptomVsSymptomChartViewInitializer.js"></script>
|
||||
<script src="../js/DictUtils.js"></script>
|
||||
<script src="../js/ScatterChart2CsvConverter.js"></script>
|
||||
<link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-2.17.2.css">
|
||||
<script src="https://code.jquery.com/qunit/qunit-2.17.2.js"></script>
|
||||
<script type="text/javascript" src="./jshamcrest.js"></script>
|
||||
@@ -30,6 +31,7 @@
|
||||
</script>
|
||||
<script src="./SymptomVsSymptomChartDataProviderTest.js"></script>
|
||||
<script src="./DictUtilsTest.js"></script>
|
||||
<script src="./ScatterChart2CsvConverterTest.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user