Skip to content

Commit 3f41d60

Browse files
committed
Fix checksum state tests
1 parent 46ae86c commit 3f41d60

File tree

1 file changed

+33
-10
lines changed

1 file changed

+33
-10
lines changed

packages/service-core/test/src/sync/BucketChecksumState.test.ts

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ bucket_definitions:
7777
syncContext,
7878
syncRequest,
7979
tokenPayload,
80-
syncRules: SYNC_RULES_GLOBAL,
80+
syncRules: {
81+
syncRules: SYNC_RULES_GLOBAL,
82+
version: 1
83+
},
8184
bucketStorage: storage
8285
});
8386

@@ -147,7 +150,10 @@ bucket_definitions:
147150
tokenPayload,
148151
// Client sets the initial state here
149152
syncRequest: { buckets: [{ name: 'global[]', after: '1' }] },
150-
syncRules: SYNC_RULES_GLOBAL,
153+
syncRules: {
154+
syncRules: SYNC_RULES_GLOBAL,
155+
version: 1
156+
},
151157
bucketStorage: storage
152158
});
153159

@@ -185,7 +191,10 @@ bucket_definitions:
185191
syncContext,
186192
tokenPayload,
187193
syncRequest,
188-
syncRules: SYNC_RULES_GLOBAL_TWO,
194+
syncRules: {
195+
syncRules: SYNC_RULES_GLOBAL_TWO,
196+
version: 2
197+
},
189198
bucketStorage: storage
190199
});
191200

@@ -253,7 +262,10 @@ bucket_definitions:
253262
tokenPayload,
254263
// Client sets the initial state here
255264
syncRequest: { buckets: [{ name: 'something_here[]', after: '1' }] },
256-
syncRules: SYNC_RULES_GLOBAL,
265+
syncRules: {
266+
syncRules: SYNC_RULES_GLOBAL,
267+
version: 1
268+
},
257269
bucketStorage: storage
258270
});
259271

@@ -294,7 +306,10 @@ bucket_definitions:
294306
syncContext,
295307
tokenPayload,
296308
syncRequest,
297-
syncRules: SYNC_RULES_GLOBAL_TWO,
309+
syncRules: {
310+
syncRules: SYNC_RULES_GLOBAL_TWO,
311+
version: 1
312+
},
298313
bucketStorage: storage
299314
});
300315

@@ -347,7 +362,10 @@ bucket_definitions:
347362
syncContext,
348363
tokenPayload,
349364
syncRequest,
350-
syncRules: SYNC_RULES_GLOBAL_TWO,
365+
syncRules: {
366+
syncRules: SYNC_RULES_GLOBAL_TWO,
367+
version: 2
368+
},
351369
bucketStorage: storage
352370
});
353371

@@ -402,7 +420,10 @@ bucket_definitions:
402420
syncContext,
403421
tokenPayload,
404422
syncRequest,
405-
syncRules: SYNC_RULES_GLOBAL_TWO,
423+
syncRules: {
424+
syncRules: SYNC_RULES_GLOBAL_TWO,
425+
version: 2
426+
},
406427
bucketStorage: storage
407428
});
408429

@@ -506,7 +527,10 @@ bucket_definitions:
506527
syncContext,
507528
tokenPayload: { sub: 'u1' },
508529
syncRequest,
509-
syncRules: SYNC_RULES_DYNAMIC,
530+
syncRules: {
531+
syncRules: SYNC_RULES_DYNAMIC,
532+
version: 1
533+
},
510534
bucketStorage: storage
511535
});
512536

@@ -607,7 +631,6 @@ bucket_definitions:
607631
describe('streams', () => {
608632
let source: { -readonly [P in keyof BucketSource]: BucketSource[P] };
609633
let storage: MockBucketChecksumStateStorage;
610-
let staticBucketIds = ['stream|0[]'];
611634

612635
function checksumState(options?: Partial<BucketChecksumStateOptions>) {
613636
const rules = new SqlSyncRules('');
@@ -617,7 +640,7 @@ bucket_definitions:
617640
syncContext,
618641
syncRequest,
619642
tokenPayload,
620-
syncRules: rules,
643+
syncRules: { syncRules: rules, version: 1 },
621644
bucketStorage: storage,
622645
...options
623646
});

0 commit comments

Comments
 (0)