Skip to content

Commit 2952053

Browse files
committed
fix: TTA-196 fixed tests for 2 fixed point digits. TODO: use that constant in tests
1 parent 4f42ff4 commit 2952053

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/app/modules/shared/pipes/substract-date-return-float/substract-date-return-float.pipe.spec.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)