[AAI] Remove Robby Maharajh & Harish Kajur as committers
[aai/sparky-fe.git] / test / utils / DateTimeChartUtil.test.js
index 4f2b181..7653e7a 100644 (file)
@@ -43,7 +43,13 @@ describe('DateTimeChartUtil Tests', () => {
       {timestamp: 1522296000000, date: 'Thu, 29 Mar 2018 04:00:00 GMT'}
     ];
     let ticksPerDay = getTicks(timestamps, 'timestamp');
+
     // expect 1 tick (timestamp) for each day between March 22 - March 29
+    
+    // CHANGED: expect(ticksPerDay.length).toBe(9);
+    // d3 scale domain().range([0,1]) will generate stray tick marks at the beginning and end of the domain.
+    // You can use scale.nice() to extend the domain so that it starts and ends on round values. (https://observablehq.com/@d3/d3-scaletime)
+    // TODO: decide if this is accepted behaviour or not
     expect(ticksPerDay.length).toBe(8);
   });
 
@@ -64,6 +70,10 @@ describe('DateTimeChartUtil Tests', () => {
     let mergedData = getTicksData(timestamps, ticksPerDay, 'timestamp');
     // expect original 4 objects plus 4 additional objects for the missing days
     // (4 additional objects will only have timestamp attribute, no date attribute)
+
+    // CHANGED: expect(mergedData.length).toBe(9);
+    // same as above, d3js scale is generating another than expected array
+    // TODO: decide if this is accepted behaviour or not
     expect(mergedData.length).toBe(12);
     expect(mergedData[0]['timestamp']).toBe(1521604800000);
     expect(mergedData[0]['date']).toBe('Thu, 21 Mar 2018 04:00:00 GMT');