@@ -201,26 +201,23 @@ describe('ElasticApiParser', () => {
201201 it ( 'should convert to GraphQLEnumType' , ( ) => {
202202 const type = parser . getEnumType ( 'f1' , [ 'AND' , 'OR' ] ) ;
203203 expect ( type ) . toBeInstanceOf ( GraphQLEnumType ) ;
204- // $FlowFixMe
205204 expect ( type . _values [ 0 ] ) . toMatchObject ( { name : 'AND' , value : 'AND' } ) ;
206- // $FlowFixMe
207205 expect ( type . _values [ 1 ] ) . toMatchObject ( { name : 'OR' , value : 'OR' } ) ;
208206 } ) ;
209207
210208 it ( "should convert '' to empty_string" , ( ) => {
211209 const type = parser . getEnumType ( 'f1' , [ '' ] ) ;
212210 expect ( type ) . toBeInstanceOf ( GraphQLEnumType ) ;
213- // $FlowFixMe
214211 expect ( type . _values [ 0 ] ) . toMatchObject ( {
215212 name : 'empty_string' ,
216213 value : '' ,
217214 } ) ;
218215 } ) ;
219216
220217 it ( 'should convert 1 to number_1' , ( ) => {
218+ // $FlowFixMe
221219 const type = parser . getEnumType ( 'f1' , [ 1 ] ) ;
222220 expect ( type ) . toBeInstanceOf ( GraphQLEnumType ) ;
223- // $FlowFixMe
224221 expect ( type . _values [ 0 ] ) . toMatchObject ( { name : 'number_1' , value : 1 } ) ;
225222 } ) ;
226223
@@ -263,6 +260,15 @@ describe('ElasticApiParser', () => {
263260 defaultValue : 'ABC' ,
264261 } ) ;
265262 } ) ;
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+ } ) ;
266272 } ) ;
267273
268274 describe ( 'settingsToArgMap()' , ( ) => {
0 commit comments