@@ -378,21 +378,18 @@ describe('App', () => {
378378 expect ( screen . getAllByText ( 'No Plots to Display' ) ) . toHaveLength ( 2 )
379379 } )
380380
381- it ( 'should render other sections given a message with only custom plots data' , ( ) => {
381+ it ( 'should render an empty state given a message with only custom plots data' , ( ) => {
382382 renderAppWithOptionalData ( {
383383 custom : customPlotsFixture
384384 } )
385385
386386 expect ( screen . queryByText ( 'Loading Plots...' ) ) . not . toBeInTheDocument ( )
387- expect ( screen . getByText ( 'Trends' ) ) . toBeInTheDocument ( )
388- expect ( screen . getByText ( 'Data Series' ) ) . toBeInTheDocument ( )
389- expect ( screen . getByText ( 'Images' ) ) . toBeInTheDocument ( )
390- expect ( screen . getByText ( 'Custom' ) ) . toBeInTheDocument ( )
391- expect ( screen . getAllByText ( 'No Plots to Display' ) ) . toHaveLength ( 2 )
392- expect ( screen . getByText ( 'No Images to Compare' ) ) . toBeInTheDocument ( )
387+ const addExperimentsButton = screen . queryByText ( 'Add Experiments' )
388+
389+ expect ( addExperimentsButton ) . toBeInTheDocument ( )
393390 } )
394391
395- it ( 'should render custom even when there is no custom plots data' , ( ) => {
392+ it ( 'should render custom with "No Plots to Display" message when there is no custom plots data' , ( ) => {
396393 renderAppWithOptionalData ( {
397394 comparison : comparisonTableFixture
398395 } )
@@ -402,6 +399,21 @@ describe('App', () => {
402399 expect ( screen . getAllByText ( 'No Plots to Display' ) ) . toHaveLength ( 3 )
403400 } )
404401
402+ it ( 'should render custom with "No Plots Added" message when there are no plots added' , ( ) => {
403+ renderAppWithOptionalData ( {
404+ comparison : comparisonTableFixture ,
405+ custom : {
406+ ...customPlotsFixture ,
407+ plots : [ ]
408+ }
409+ } )
410+
411+ expect ( screen . queryByText ( 'Loading Plots...' ) ) . not . toBeInTheDocument ( )
412+ expect ( screen . getByText ( 'Custom' ) ) . toBeInTheDocument ( )
413+ expect ( screen . getAllByText ( 'No Plots to Display' ) ) . toHaveLength ( 2 )
414+ expect ( screen . getByText ( 'No Plots Added' ) ) . toBeInTheDocument ( )
415+ } )
416+
405417 it ( 'should render the comparison table when given a message with comparison plots data' , ( ) => {
406418 const expectedSectionName = 'Images'
407419
@@ -837,6 +849,7 @@ describe('App', () => {
837849
838850 it ( 'should add a custom plot if a user creates a custom plot' , ( ) => {
839851 renderAppWithOptionalData ( {
852+ comparison : comparisonTableFixture ,
840853 custom : {
841854 ...customPlotsFixture ,
842855 plots : customPlotsFixture . plots . slice ( 1 )
@@ -863,6 +876,7 @@ describe('App', () => {
863876
864877 it ( 'should remove a custom plot if a user deletes a custom plot' , ( ) => {
865878 renderAppWithOptionalData ( {
879+ comparison : comparisonTableFixture ,
866880 custom : customPlotsFixture
867881 } )
868882
0 commit comments