1
+ import { faker } from "@faker-js/faker/." ;
1
2
import { gSchema$EventBase } from "@core/types/gcal" ;
2
3
import {
3
4
generateGcalId ,
6
7
mockRegularGcalEvent ,
7
8
} from "./gcal.event.factory" ;
8
9
9
- /* Sets of events, pre-organized as a convenience for testing */
10
+ /* Batch of events, pre-organized as a convenience for testing */
10
11
11
- export const mockGcalEvents = (
12
+ export const mockAndCategorizeGcalEvents = (
12
13
baseId ?: string ,
13
14
fixedStart ?: string ,
14
15
fixedEnd ?: string ,
@@ -18,14 +19,14 @@ export const mockGcalEvents = (
18
19
const endDateTime = fixedEnd || "2025-07-16T10:56:29.000Z" ;
19
20
20
21
// Create a base recurring event
22
+ const tz = faker . location . timeZone ( ) ;
21
23
const baseRecurringEvent = mockRecurringGcalBaseEvent ( {
22
24
id : baseId || generateGcalId ( ) ,
23
25
summary : "Recurrence" ,
24
26
recurrence : [ "RRULE:FREQ=WEEKLY" ] ,
25
- start : { dateTime : startDateTime , timeZone : "UTC" } ,
26
- end : { dateTime : endDateTime , timeZone : "UTC" } ,
27
+ start : { dateTime : startDateTime , timeZone : tz } ,
28
+ end : { dateTime : endDateTime , timeZone : tz } ,
27
29
} ) as gSchema$EventBase ;
28
- console . log ( "mocked base with:" , baseId ) ;
29
30
30
31
// Create instances of the recurring event
31
32
const instances = mockRecurringGcalInstances ( baseRecurringEvent , 2 , 7 ) ;
@@ -45,9 +46,6 @@ export const mockGcalEvents = (
45
46
46
47
const all = [ baseRecurringEvent , ...instances , regularEvent , cancelledEvent ] ;
47
48
48
- const instanceIds = instances . map ( ( i ) => i . id ) ;
49
- console . log ( "mocked instanceIds:" , instanceIds ) ;
50
-
51
49
return {
52
50
gcalEvents : {
53
51
baseRecurringEvent,
0 commit comments