Skip to content

Commit

Permalink
improve code readability for timepadding Unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MGJamJam committed Jul 11, 2024
1 parent bb91a37 commit ef98afd
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions src/utils/dataUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ describe('padAndSortTimeSeries', () => {
//assert
expect(result).toEqual([
[1712919540000, 0], //Friday, 12 April 2024 10:59:00
[1712919600000, 2], //Friday, 12 April 2024 11:00:00
data[0],
[1712919660000, 0], //Friday, 12 April 2024 11:01:00
[1712919720000, 5], //Friday, 12 April 2024 11:02:00
data[1],
[1712919780000, 0], //Friday, 12 April 2024 11:03:00
]);
});
Expand All @@ -110,11 +110,11 @@ describe('padAndSortTimeSeries', () => {
//assert
expect(result).toEqual([
[1712916000000, 0], //Friday, 12 April 2024 10:00:00
[1712919600000, 7], //Friday, 12 April 2024 11:00:00
data[0],
[1712923200000, 0], //Friday, 12 April 2024 12:00:00
[1712926800000, 0], //Friday, 12 April 2024 13:00:00
[1712930400000, 5], //Friday, 12 April 2024 14:00:00
[1712934000000, 2], //Friday, 12 April 2024 15:00:00
data[1],
data[2],
]);
});

Expand All @@ -134,10 +134,10 @@ describe('padAndSortTimeSeries', () => {
//assert
expect(result).toEqual([
[1712917800000, 0], //Friday, 12 April 2024 10:30:00
[1713004200000, 2], //Saturday, 13 April 2024 10:30:00
data[0],
[1713090600000, 0], //Sunday, 14 April 2024 10:30:00
[1713177000000, 0], //Monday, 15 April 2024 10:30:00
[1713263400000, 5], //Tuesday, 16 April 2024 10:30:00
data[1],
[1713349800000, 0], //Wednesday, 17 April 2024 10:30:00
]);
});
Expand All @@ -158,10 +158,10 @@ describe('padAndSortTimeSeries', () => {

//assert
expect(result).toEqual([
[1706740200000, 1], //Wednesday, 31 January 2024 22:30:00
data[0],
[1709245800000, 0], //Thursday, 29 February 2024 22:30:00
[1711924200000, 2], //Sunday, 31 March 2024 22:30:00
[1714516200000, 5], //Tuesday, 30 April 2024 22:30:00
data[1],
data[2],
[1717194600000, 0], // Friday, 31 May 2024 22:30:00
]);
});
Expand All @@ -183,8 +183,8 @@ describe('padAndSortTimeSeries', () => {
expect(result).toEqual([
[1706826600000, 0], //Thursday, 1 February 2024 22:30:00
[1709332200000, 0], //Friday, 1 March 2024 22:30:00
[1712010600000, 2], //Monday, 1 April 2024 22:30:00
[1714602600000, 5], //Wednesday, 1 May 2024 22:30:00
data[0],
data[1],
[1717281000000, 0], //Saturday, 1 June 2024 22:30:00
]);
});
Expand All @@ -205,9 +205,9 @@ describe('padAndSortTimeSeries', () => {
//assert
expect(result).toEqual([
[1712919540000, 'BROWSER', 'DEVICE_TYPE', 0], //Friday, 12 April 2024 10:59:00
[1712919600000, 'BROWSER', 'DEVICE_TYPE', 2], //Friday, 12 April 2024 11:00:00
data[0],
[1712919660000, 'BROWSER', 'DEVICE_TYPE', 0], //Friday, 12 April 2024 11:01:00
[1712919720000, 'BROWSER', 'DEVICE_TYPE', 5], //Friday, 12 April 2024 11:02:00
data[1],
[1712919780000, 'BROWSER', 'DEVICE_TYPE', 0], //Friday, 12 April 2024 11:03:00
]);
});
Expand All @@ -229,11 +229,11 @@ describe('padAndSortTimeSeries', () => {
//assert
expect(result).toEqual([
[1712916000000, 'BROWSER', 'DEVICE_TYPE', 0], //Friday, 12 April 2024 10:00:00
[1712919600000, 'BROWSER', 'DEVICE_TYPE', 7], //Friday, 12 April 2024 11:00:00
data[0],
[1712923200000, 'BROWSER', 'DEVICE_TYPE', 0], //Friday, 12 April 2024 12:00:00
[1712926800000, 'BROWSER', 'DEVICE_TYPE', 0], //Friday, 12 April 2024 13:00:00
[1712930400000, 'BROWSER', 'DEVICE_TYPE', 5], //Friday, 12 April 2024 14:00:00
[1712934000000, 'BROWSER', 'DEVICE_TYPE', 2], //Friday, 12 April 2024 15:00:00
data[1],
data[2],
]);
});

Expand All @@ -253,10 +253,10 @@ describe('padAndSortTimeSeries', () => {
//assert
expect(result).toEqual([
[1712917800000, 'BROWSER', 'DEVICE_TYPE', 0], //Friday, 12 April 2024 10:30:00
[1713004200000, 'BROWSER', 'DEVICE_TYPE', 2], //Saturday, 13 April 2024 10:30:00
data[0],
[1713090600000, 'BROWSER', 'DEVICE_TYPE', 0], //Sunday, 14 April 2024 10:30:00
[1713177000000, 'BROWSER', 'DEVICE_TYPE', 0], //Monday, 15 April 2024 10:30:00
[1713263400000, 'BROWSER', 'DEVICE_TYPE', 5], //Tuesday, 16 April 2024 10:30:00
data[1],
[1713349800000, 'BROWSER', 'DEVICE_TYPE', 0], //Wednesday, 17 April 2024 10:30:00
]);
});
Expand All @@ -277,10 +277,10 @@ describe('padAndSortTimeSeries', () => {

//assert
expect(result).toEqual([
[1706740200000, 'BROWSER', 'DEVICE_TYPE', 1], //Wednesday, 31 January 2024 22:30:00
data[0],
[1709245800000, 'BROWSER', 'DEVICE_TYPE', 0], //Thursday, 29 February 2024 22:30:00
[1711924200000, 'BROWSER', 'DEVICE_TYPE', 2], //Sunday, 31 March 2024 22:30:00
[1714516200000, 'BROWSER', 'DEVICE_TYPE', 5], //Tuesday, 30 April 2024 22:30:00
data[1],
data[2],
[1717194600000, 'BROWSER', 'DEVICE_TYPE', 0], // Friday, 31 May 2024 22:30:00
]);
});
Expand All @@ -302,8 +302,8 @@ describe('padAndSortTimeSeries', () => {
expect(result).toEqual([
[1706826600000, 'BROWSER', 'DEVICE_TYPE', 0], //Thursday, 1 February 2024 22:30:00
[1709332200000, 'BROWSER', 'DEVICE_TYPE', 0], //Friday, 1 March 2024 22:30:00
[1712010600000, 'BROWSER', 'DEVICE_TYPE', 2], //Monday, 1 April 2024 22:30:00
[1714602600000, 'BROWSER', 'DEVICE_TYPE', 5], //Wednesday, 1 May 2024 22:30:00
data[0],
data[1],
[1717281000000, 'BROWSER', 'DEVICE_TYPE', 0], //Saturday, 1 June 2024 22:30:00
]);
});
Expand Down

0 comments on commit ef98afd

Please sign in to comment.