@@ -13,7 +13,7 @@ import {
13
13
SearchAttributes ,
14
14
} from '@temporalio/client' ;
15
15
import { msToNumber } from '@temporalio/common/lib/time' ;
16
- import { searchAttributePair , SearchAttributeType } from '@temporalio/common' ;
16
+ import { searchAttributePair , SearchAttributeType , TypedSearchAttributes } from '@temporalio/common' ;
17
17
import { registerDefaultCustomSearchAttributes , RUN_INTEGRATION_TESTS } from './helpers' ;
18
18
19
19
export interface Context {
@@ -169,7 +169,7 @@ if (RUN_INTEGRATION_TESTS) {
169
169
searchAttributes : {
170
170
CustomKeywordField : [ 'test-value2' ] ,
171
171
} ,
172
- typedSearchAttributes : [ searchAttributePair ( 'CustomInt ' , SearchAttributeType . INT , 42 ) ] ,
172
+ typedSearchAttributes : [ searchAttributePair ( 'CustomIntField ' , SearchAttributeType . INT , 42 ) ] ,
173
173
} ,
174
174
} ) ;
175
175
@@ -179,15 +179,17 @@ if (RUN_INTEGRATION_TESTS) {
179
179
t . is ( describedSchedule . action . type , 'startWorkflow' ) ;
180
180
t . is ( describedSchedule . action . workflowType , 'dummyWorkflow' ) ;
181
181
t . deepEqual ( describedSchedule . action . memo , { 'my-memo' : 'foo' } ) ;
182
- t . deepEqual ( describedSchedule . action . searchAttributes , [
183
- [ 'CustomKeywordField' , [ 'test-value2' ] ] ,
184
- [ 'CustomInt' , 42 ] ,
185
- ] ) ;
186
- t . deepEqual ( describedSchedule . action . typedSearchAttributes , [
187
- searchAttributePair ( 'CustomInt' , SearchAttributeType . INT , 42 ) ,
188
- // Note that the typed search attribute infers type TEXT from the value.
189
- searchAttributePair ( 'CustomKeywordField' , SearchAttributeType . TEXT , 'test-value2' ) ,
190
- ] ) ;
182
+ t . deepEqual ( describedSchedule . action . searchAttributes , {
183
+ CustomKeywordField : [ 'test-value2' ] ,
184
+ CustomIntField : [ 42 ] ,
185
+ } ) ;
186
+ t . deepEqual (
187
+ describedSchedule . action . typedSearchAttributes ,
188
+ new TypedSearchAttributes ( [
189
+ searchAttributePair ( 'CustomIntField' , SearchAttributeType . INT , 42 ) ,
190
+ searchAttributePair ( 'CustomKeywordField' , SearchAttributeType . KEYWORD , 'test-value2' ) ,
191
+ ] )
192
+ ) ;
191
193
} finally {
192
194
await handle . delete ( ) ;
193
195
}
@@ -212,7 +214,7 @@ if (RUN_INTEGRATION_TESTS) {
212
214
searchAttributes : {
213
215
CustomKeywordField : [ 'test-value2' ] ,
214
216
} ,
215
- typedSearchAttributes : [ searchAttributePair ( 'CustomInt ' , SearchAttributeType . INT , 42 ) ] ,
217
+ typedSearchAttributes : [ searchAttributePair ( 'CustomIntField ' , SearchAttributeType . INT , 42 ) ] ,
216
218
} ,
217
219
} ) ;
218
220
@@ -223,15 +225,17 @@ if (RUN_INTEGRATION_TESTS) {
223
225
t . is ( describedSchedule . action . workflowType , 'dummyWorkflowWith2Args' ) ;
224
226
t . deepEqual ( describedSchedule . action . args , [ 3 , 4 ] ) ;
225
227
t . deepEqual ( describedSchedule . action . memo , { 'my-memo' : 'foo' } ) ;
226
- t . deepEqual ( describedSchedule . action . searchAttributes , [
227
- [ 'CustomKeywordField' , [ 'test-value2' ] ] ,
228
- [ 'CustomInt' , 42 ] ,
229
- ] ) ;
230
- t . deepEqual ( describedSchedule . action . typedSearchAttributes , [
231
- searchAttributePair ( 'CustomInt' , SearchAttributeType . INT , 42 ) ,
232
- // Note that the typed search attribute "guesses" TEXT, inferred from the value.
233
- searchAttributePair ( 'CustomKeywordField' , SearchAttributeType . TEXT , 'test-value2' ) ,
234
- ] ) ;
228
+ t . deepEqual ( describedSchedule . action . searchAttributes , {
229
+ CustomKeywordField : [ 'test-value2' ] ,
230
+ CustomIntField : [ 42 ] ,
231
+ } ) ;
232
+ t . deepEqual (
233
+ describedSchedule . action . typedSearchAttributes ,
234
+ new TypedSearchAttributes ( [
235
+ searchAttributePair ( 'CustomIntField' , SearchAttributeType . INT , 42 ) ,
236
+ searchAttributePair ( 'CustomKeywordField' , SearchAttributeType . KEYWORD , 'test-value2' ) ,
237
+ ] )
238
+ ) ;
235
239
} finally {
236
240
await handle . delete ( ) ;
237
241
}
@@ -342,7 +346,7 @@ if (RUN_INTEGRATION_TESTS) {
342
346
searchAttributes : {
343
347
CustomKeywordField : [ 'test-value2' ] ,
344
348
} ,
345
- typedSearchAttributes : [ searchAttributePair ( 'CustomInt ' , SearchAttributeType . INT , 42 ) ] ,
349
+ typedSearchAttributes : [ searchAttributePair ( 'CustomIntField ' , SearchAttributeType . INT , 42 ) ] ,
346
350
} ,
347
351
} ) ;
348
352
@@ -587,7 +591,7 @@ if (RUN_INTEGRATION_TESTS) {
587
591
taskQueue,
588
592
} ,
589
593
searchAttributes,
590
- typedSearchAttributes : [ searchAttributePair ( 'CustomInt ' , SearchAttributeType . INT , 42 ) ] ,
594
+ typedSearchAttributes : [ searchAttributePair ( 'CustomIntField ' , SearchAttributeType . INT , 42 ) ] ,
591
595
} )
592
596
) ;
593
597
}
0 commit comments