@@ -6,14 +6,15 @@ describe('SubstractDatePipeDisplayAsFloat', () => {
66 expect ( pipe ) . toBeTruthy ( ) ;
77 } ) ;
88
9- it ( 'returns the date diff as float hours (xx.x)' , ( ) => {
9+ /*TODO: tests will be more robust if they take into account FIXED_POINT_DIGITS*/
10+ it ( 'returns the date diff as float hours (xx.xx)' , ( ) => {
1011 [
11- { endDate : '2021-04-11T10:20:00Z' , startDate : '2021-04-11T08:00:00Z' , expectedDiff : '2.3 ' } ,
12- { endDate : '2021-04-11T17:40:00Z' , startDate : '2021-04-11T17:10:00Z' , expectedDiff : '0.5 ' } ,
13- { endDate : '2021-04-11T18:18:00Z' , startDate : '2021-04-11T18:00:00Z' , expectedDiff : '0.3 ' } ,
14- { endDate : '2021-04-12T12:18:00Z' , startDate : '2021-04-11T10:00:00Z' , expectedDiff : '26.3 ' } ,
15- { endDate : '2021-04-12T10:01:00Z' , startDate : '2021-04-12T10:00:00Z' , expectedDiff : '0.0 ' } ,
16- { endDate : '2021-04-11T11:27:00Z' , startDate : '2021-04-11T10:03:45Z' , expectedDiff : '1.4 ' } ,
12+ { endDate : '2021-04-11T10:20:00Z' , startDate : '2021-04-11T08:00:00Z' , expectedDiff : '2.33 ' } ,
13+ { endDate : '2021-04-11T17:40:00Z' , startDate : '2021-04-11T17:10:00Z' , expectedDiff : '0.50 ' } ,
14+ { endDate : '2021-04-11T18:18:00Z' , startDate : '2021-04-11T18:00:00Z' , expectedDiff : '0.30 ' } ,
15+ { endDate : '2021-04-12T12:18:00Z' , startDate : '2021-04-11T10:00:00Z' , expectedDiff : '26.30 ' } ,
16+ { endDate : '2021-04-12T10:01:00Z' , startDate : '2021-04-12T10:00:00Z' , expectedDiff : '0.02 ' } ,
17+ { endDate : '2021-04-11T11:27:00Z' , startDate : '2021-04-11T10:03:45Z' , expectedDiff : '1.39 ' } ,
1718 ] . forEach ( ( { startDate, endDate, expectedDiff } ) => {
1819 const fromDate = new Date ( endDate ) ;
1920 const substractDate = new Date ( startDate ) ;
0 commit comments