@@ -6,11 +6,27 @@ import type {
66 CtrlStateSSubscription ,
77 CtrlRunNoQuery ,
88 CtrlRunNoSSubscription ,
9+ CtrlTraceIdsQuery ,
10+ CtrlTraceIdsSSubscription ,
11+ CtrlContinuousEnabledQuery ,
12+ CtrlContinuousEnabledSSubscription ,
13+ ScheduleAutoModeModeQuery ,
14+ QScheduleAutoModeStateQuery ,
15+ ScheduleAutoModeStateSSubscription ,
16+ ScheduleAutoModeModeSSubscription ,
17+ ScheduleQueueItemsQuery ,
18+ ScheduleQueueItemsSSubscription ,
919} from "@/graphql/codegen/generated" ;
1020
21+ import { useSubscribeContinuousEnabled } from "../use-continuous-enabled-subscription" ;
1122import { useSubscribeRunNo } from "../use-run-no-subscription" ;
23+ import { useSubscribeScheduleAutoModeMode } from "../use-schedule-auto-mode-mode-subscription" ;
24+ import { useSubscribeScheduleAutoModeState } from "../use-schedule-auto-mode-state-subscription" ;
25+ import { useSubscribeScheduleQueueItems } from "../use-schedule-queue-items-subscription" ;
1226import { useSubscribeState } from "../use-state-subscription" ;
27+ import { useSubscribeTraceIds } from "../use-trace_ids-subscription" ;
1328
29+ import { fcScheduleQueueItem } from "./fc" ;
1430import { runPropertyTest } from "./run-property-test" ;
1531
1632// Mock functions used in runPropertyTest()
@@ -50,3 +66,118 @@ it("useSubscribeRunNo", async () => {
5066
5167 await runPropertyTest ( useSubscribeRunNo , mapQuery , mapSub , fcQueryData , fcSubData ) ;
5268} ) ;
69+
70+ it ( "useSubscribeTraceIds" , async ( ) => {
71+ type QueryData = CtrlTraceIdsQuery ;
72+ type SubData = CtrlTraceIdsSSubscription ;
73+
74+ const mapQuery = ( d : QueryData | undefined ) => d ?. ctrl . traceIds ;
75+ const mapSub = ( d : SubData | undefined ) => d ?. ctrlTraceIds ;
76+
77+ const fcTraceIds = fc . array ( fc . integer ( ) ) ;
78+ const fcQueryData : fc . Arbitrary < QueryData > = fc . record ( {
79+ ctrl : fc . record ( { traceIds : fcTraceIds } ) ,
80+ } ) ;
81+ const fcSubData : fc . Arbitrary < SubData > = fc . record ( {
82+ ctrlTraceIds : fcTraceIds ,
83+ } ) ;
84+
85+ await runPropertyTest ( useSubscribeTraceIds , mapQuery , mapSub , fcQueryData , fcSubData ) ;
86+ } ) ;
87+
88+ it ( "useSubscribeContinuousEnabled" , async ( ) => {
89+ type QueryData = CtrlContinuousEnabledQuery ;
90+ type SubData = CtrlContinuousEnabledSSubscription ;
91+
92+ const mapQuery = ( d : QueryData | undefined ) => d ?. ctrl . continuousEnabled ;
93+ const mapSub = ( d : SubData | undefined ) => d ?. ctrlContinuousEnabled ;
94+
95+ const fcContinuousEnabled = fc . boolean ( ) ;
96+ const fcQueryData : fc . Arbitrary < QueryData > = fc . record ( {
97+ ctrl : fc . record ( { continuousEnabled : fcContinuousEnabled } ) ,
98+ } ) ;
99+ const fcSubData : fc . Arbitrary < SubData > = fc . record ( {
100+ ctrlContinuousEnabled : fcContinuousEnabled ,
101+ } ) ;
102+
103+ await runPropertyTest (
104+ useSubscribeContinuousEnabled ,
105+ mapQuery ,
106+ mapSub ,
107+ fcQueryData ,
108+ fcSubData ,
109+ ) ;
110+ } ) ;
111+
112+ it ( "useSubscribeScheduleAutoModeMode" , async ( ) => {
113+ type QueryData = ScheduleAutoModeModeQuery ;
114+ type SubData = ScheduleAutoModeModeSSubscription ;
115+
116+ const mapQuery = ( d : QueryData | undefined ) => d ?. schedule . autoMode . mode ;
117+ const mapSub = ( d : SubData | undefined ) => d ?. scheduleAutoModeMode ;
118+
119+ const fcScheduleAutoMode = fc . string ( ) ;
120+ const fcQueryData : fc . Arbitrary < QueryData > = fc . record ( {
121+ schedule : fc . record ( { autoMode : fc . record ( { mode : fcScheduleAutoMode } ) } ) ,
122+ } ) ;
123+ const fcSubData : fc . Arbitrary < SubData > = fc . record ( {
124+ scheduleAutoModeMode : fcScheduleAutoMode ,
125+ } ) ;
126+
127+ await runPropertyTest (
128+ useSubscribeScheduleAutoModeMode ,
129+ mapQuery ,
130+ mapSub ,
131+ fcQueryData ,
132+ fcSubData ,
133+ ) ;
134+ } ) ;
135+
136+ it ( "useSubscribeScheduleAutoModeState" , async ( ) => {
137+ type QueryData = QScheduleAutoModeStateQuery ;
138+ type SubData = ScheduleAutoModeStateSSubscription ;
139+
140+ const mapQuery = ( d : QueryData | undefined ) => d ?. schedule . autoMode . state ;
141+ const mapSub = ( d : SubData | undefined ) => d ?. scheduleAutoModeState ;
142+
143+ const fcScheduleAutoModeState = fc . string ( ) ;
144+ const fcQueryData : fc . Arbitrary < QueryData > = fc . record ( {
145+ schedule : fc . record ( { autoMode : fc . record ( { state : fcScheduleAutoModeState } ) } ) ,
146+ } ) ;
147+ const fcSubData : fc . Arbitrary < SubData > = fc . record ( {
148+ scheduleAutoModeState : fcScheduleAutoModeState ,
149+ } ) ;
150+
151+ await runPropertyTest (
152+ useSubscribeScheduleAutoModeState ,
153+ mapQuery ,
154+ mapSub ,
155+ fcQueryData ,
156+ fcSubData ,
157+ ) ;
158+ } ) ;
159+
160+ it ( "useSubscribeScheduleQueueItems" , async ( ) => {
161+ type QueryData = ScheduleQueueItemsQuery ;
162+ type SubData = ScheduleQueueItemsSSubscription ;
163+
164+ const mapQuery = ( d : QueryData | undefined ) => d ?. schedule . queue . items ;
165+ const mapSub = ( d : SubData | undefined ) => d ?. scheduleQueueItems ;
166+
167+ const fcQueryData : fc . Arbitrary < QueryData > = fc . record ( {
168+ schedule : fc . record ( {
169+ queue : fc . record ( { items : fc . array ( fcScheduleQueueItem ) } ) ,
170+ } ) ,
171+ } ) ;
172+ const fcSubData : fc . Arbitrary < SubData > = fc . record ( {
173+ scheduleQueueItems : fc . array ( fcScheduleQueueItem ) ,
174+ } ) ;
175+
176+ await runPropertyTest (
177+ useSubscribeScheduleQueueItems ,
178+ mapQuery ,
179+ mapSub ,
180+ fcQueryData ,
181+ fcSubData ,
182+ ) ;
183+ } ) ;
0 commit comments