@@ -244,7 +244,7 @@ describe('App', () => {
244244 renderAppWithOptionalData ( {
245245 checkpoint : null
246246 } )
247- const emptyState = await screen . findByText ( 'No Plots to Display .' )
247+ const emptyState = await screen . findByText ( 'No Plots Detected .' )
248248
249249 expect ( emptyState ) . toBeInTheDocument ( )
250250 } )
@@ -271,7 +271,7 @@ describe('App', () => {
271271 size : PlotSizeNumber . REGULAR
272272 } ,
273273 hasPlots : true ,
274- hasSelectedPlots : true ,
274+ hasUnselectedPlots : false ,
275275 sectionCollapsed : DEFAULT_SECTION_COLLAPSED ,
276276 selectedRevisions : [
277277 {
@@ -289,21 +289,29 @@ describe('App', () => {
289289 expect ( loading ) . toHaveLength ( 3 )
290290 } )
291291
292- it ( 'should only render the Add Plots get started button when there are experiments but no plots are selected ' , async ( ) => {
292+ it ( 'should render the Add Plots and Add Experiments get started button when there are experiments which have plots that are all unselected ' , async ( ) => {
293293 renderAppWithOptionalData ( {
294294 checkpoint : null ,
295295 hasPlots : true ,
296- hasSelectedPlots : false ,
296+ hasUnselectedPlots : true ,
297297 selectedRevisions : [ { } as Revision ]
298298 } )
299- const addExperimentsButton = screen . queryByText ( 'Add Experiments' )
299+ const addExperimentsButton = await screen . findByText ( 'Add Experiments' )
300300 const addPlotsButton = await screen . findByText ( 'Add Plots' )
301301
302- expect ( addExperimentsButton ) . not . toBeInTheDocument ( )
302+ expect ( addExperimentsButton ) . toBeInTheDocument ( )
303303 expect ( addPlotsButton ) . toBeInTheDocument ( )
304304
305305 mockPostMessage . mockReset ( )
306306
307+ fireEvent . click ( addExperimentsButton )
308+
309+ expect ( mockPostMessage ) . toHaveBeenCalledWith ( {
310+ type : MessageFromWebviewType . SELECT_EXPERIMENTS
311+ } )
312+
313+ mockPostMessage . mockReset ( )
314+
307315 fireEvent . click ( addPlotsButton )
308316
309317 expect ( mockPostMessage ) . toHaveBeenCalledWith ( {
@@ -312,11 +320,11 @@ describe('App', () => {
312320 mockPostMessage . mockReset ( )
313321 } )
314322
315- it ( 'should only render the Add Experiments get started button when no plots or experiments are selected' , async ( ) => {
323+ it ( 'should render only the Add Experiments get started button when no experiments are selected' , async ( ) => {
316324 renderAppWithOptionalData ( {
317325 checkpoint : null ,
318326 hasPlots : true ,
319- hasSelectedPlots : false ,
327+ hasUnselectedPlots : false ,
320328 selectedRevisions : undefined
321329 } )
322330 const addExperimentsButton = await screen . findByText ( 'Add Experiments' )
0 commit comments