Skip to content

Commit a7dcbb6

Browse files
committed
Fix limiter worker tests for boundary-day counting
1 parent 244212d commit a7dcbb6

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

workers/limiter/tests/index.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ const REGULAR_WORKSPACES_CHECK_EVENT: RegularWorkspacesCheckEvent = {
2727
*/
2828
const LAST_CHARGE_DATE = new Date(1585742400 * 1000);
2929

30+
/**
31+
* Timestamp inside the boundary day of LAST_CHARGE_DATE (2020-04-01T16:00:00Z):
32+
* such events are counted from the raw collections, later ones — via dailyEvents
33+
*/
34+
const BOUNDARY_DAY_TIMESTAMP = 1585756800;
35+
3036
describe('Limiter worker', () => {
3137
let connection: MongoClient;
3238
let db: Db;
@@ -89,7 +95,7 @@ describe('Limiter worker', () => {
8995
usersAffected: 0,
9096
visitedBy: [],
9197
groupHash: 'ade987831d0d0d167aeea685b49db164eb4e113fd027858eef7f69d049357f62',
92-
timestamp: 1586892935,
98+
timestamp: BOUNDARY_DAY_TIMESTAMP,
9399
payload: {
94100
title: 'Mocked event',
95101
},

0 commit comments

Comments
 (0)