@@ -201,26 +201,23 @@ describe('ElasticApiParser', () => {
201
201
it ( 'should convert to GraphQLEnumType' , ( ) => {
202
202
const type = parser . getEnumType ( 'f1' , [ 'AND' , 'OR' ] ) ;
203
203
expect ( type ) . toBeInstanceOf ( GraphQLEnumType ) ;
204
- // $FlowFixMe
205
204
expect ( type . _values [ 0 ] ) . toMatchObject ( { name : 'AND' , value : 'AND' } ) ;
206
- // $FlowFixMe
207
205
expect ( type . _values [ 1 ] ) . toMatchObject ( { name : 'OR' , value : 'OR' } ) ;
208
206
} ) ;
209
207
210
208
it ( "should convert '' to empty_string" , ( ) => {
211
209
const type = parser . getEnumType ( 'f1' , [ '' ] ) ;
212
210
expect ( type ) . toBeInstanceOf ( GraphQLEnumType ) ;
213
- // $FlowFixMe
214
211
expect ( type . _values [ 0 ] ) . toMatchObject ( {
215
212
name : 'empty_string' ,
216
213
value : '' ,
217
214
} ) ;
218
215
} ) ;
219
216
220
217
it ( 'should convert 1 to number_1' , ( ) => {
218
+ // $FlowFixMe
221
219
const type = parser . getEnumType ( 'f1' , [ 1 ] ) ;
222
220
expect ( type ) . toBeInstanceOf ( GraphQLEnumType ) ;
223
- // $FlowFixMe
224
221
expect ( type . _values [ 0 ] ) . toMatchObject ( { name : 'number_1' , value : 1 } ) ;
225
222
} ) ;
226
223
@@ -263,6 +260,15 @@ describe('ElasticApiParser', () => {
263
260
defaultValue : 'ABC' ,
264
261
} ) ;
265
262
} ) ;
263
+
264
+ it ( 'should set defaultValue="json" for `format` argument' , ( ) => {
265
+ expect (
266
+ parser . paramToGraphQLArgConfig ( { type : 'string' } , 'format' )
267
+ ) . toMatchObject ( {
268
+ type : GraphQLString ,
269
+ defaultValue : 'json' ,
270
+ } ) ;
271
+ } ) ;
266
272
} ) ;
267
273
268
274
describe ( 'settingsToArgMap()' , ( ) => {
0 commit comments