@@ -497,19 +497,26 @@ describe('pickPlotConfiguration', () => {
497497 } )
498498
499499 it ( 'should return early if the user does not pick a y field' , async ( ) => {
500- mockedPickFiles . mockResolvedValueOnce ( [ '/file.json' ] )
501- mockedLoadDataFiles . mockResolvedValueOnce ( [
500+ mockedPickFiles . mockResolvedValue ( [ '/file.json' ] )
501+ mockedLoadDataFiles . mockResolvedValue ( [
502502 { data : mockValidData , file : 'file.json' }
503503 ] )
504- mockedQuickPickOne . mockResolvedValueOnce ( 'simple' )
505- mockedGetInput . mockResolvedValueOnce ( 'simple_plot' )
506- mockedQuickPickValue . mockResolvedValueOnce ( 'actual' )
507- mockedQuickPickValues . mockResolvedValueOnce ( undefined )
504+ mockedQuickPickOne . mockResolvedValue ( 'simple' )
505+ mockedGetInput . mockResolvedValue ( 'simple_plot' )
506+ mockedQuickPickValue . mockResolvedValue ( 'actual' )
507+ mockedQuickPickValues
508+ . mockResolvedValueOnce ( undefined )
509+ . mockResolvedValueOnce ( [ ] )
508510
509- const result = await pickPlotConfiguration ( '/' )
511+ const undefinedResult = await pickPlotConfiguration ( '/' )
510512
511513 expect ( mockedQuickPickValues ) . toHaveBeenCalledTimes ( 1 )
512- expect ( result ) . toStrictEqual ( undefined )
514+ expect ( undefinedResult ) . toStrictEqual ( undefined )
515+
516+ const emptyFieldsResult = await pickPlotConfiguration ( '/' )
517+
518+ expect ( mockedQuickPickValues ) . toHaveBeenCalledTimes ( 2 )
519+ expect ( emptyFieldsResult ) . toStrictEqual ( undefined )
513520 } )
514521
515522 it ( 'should return early if the user does not pick a title' , async ( ) => {
0 commit comments