@@ -31,6 +31,7 @@ const DEFAULT_DATA = {
3131 version : '1.0.0'
3232 } ,
3333 hasData : false ,
34+ isAboveLatestTestedVersion : false ,
3435 isPythonExtensionUsed : false ,
3536 isStudioConnected : false ,
3637 needsGitCommit : false ,
@@ -394,7 +395,9 @@ describe('App', () => {
394395 projectInitialized : false
395396 } )
396397
397- const iconWrapper = screen . getAllByTestId ( 'info-tooltip-toggle' ) [ 0 ]
398+ const iconWrapper = within (
399+ screen . getByTestId ( 'dvc-section-details' )
400+ ) . getByTestId ( 'info-tooltip-toggle' )
398401
399402 expect (
400403 within ( iconWrapper ) . getByTestId ( TooltipIconType . ERROR )
@@ -405,13 +408,47 @@ describe('App', () => {
405408 renderApp ( { remoteList : { mockRoot : undefined } } )
406409 expect ( screen . queryByText ( 'DVC is not setup' ) ) . not . toBeInTheDocument ( )
407410
408- const iconWrapper = screen . getAllByTestId ( 'info-tooltip-toggle' ) [ 0 ]
411+ const iconWrapper = within (
412+ screen . getByTestId ( 'dvc-section-details' )
413+ ) . getByTestId ( 'info-tooltip-toggle' )
409414
410415 expect (
411416 within ( iconWrapper ) . getByTestId ( TooltipIconType . PASSED )
412417 ) . toBeInTheDocument ( )
413418 } )
414419
420+ it ( 'should add a warning icon and message if version is above the latest tested version' , ( ) => {
421+ renderApp ( {
422+ isAboveLatestTestedVersion : true
423+ } )
424+
425+ const iconWrapper = within (
426+ screen . getByTestId ( 'dvc-section-details' )
427+ ) . getByTestId ( 'info-tooltip-toggle' )
428+
429+ expect (
430+ within ( iconWrapper ) . getByTestId ( TooltipIconType . WARNING )
431+ ) . toBeInTheDocument ( )
432+
433+ fireEvent . mouseEnter ( iconWrapper )
434+
435+ expect (
436+ screen . getByText (
437+ 'The located version has not been tested against the extension. If you are experiencing unexpected behaviour, first try to update the extension. If there are no updates available, please downgrade DVC to the same minor version as displayed and reload the window.'
438+ )
439+ ) . toBeInTheDocument ( )
440+ } )
441+ } )
442+
443+ describe ( 'Experiments' , ( ) => {
444+ it ( 'should show a screen saying that dvc is not setup if the project is not initialized' , ( ) => {
445+ renderApp ( {
446+ projectInitialized : false
447+ } )
448+
449+ expect ( screen . getByText ( 'DVC is not setup' ) ) . toBeInTheDocument ( )
450+ } )
451+
415452 it ( 'should open the dvc section when clicking the Setup DVC button on the dvc is not setup screen' , ( ) => {
416453 renderApp ( {
417454 projectInitialized : false ,
@@ -489,7 +526,9 @@ describe('App', () => {
489526 it ( 'should show an error icon if experiments are not setup' , ( ) => {
490527 renderApp ( )
491528
492- const iconWrapper = screen . getAllByTestId ( 'info-tooltip-toggle' ) [ 1 ]
529+ const iconWrapper = within (
530+ screen . getByTestId ( 'experiments-section-details' )
531+ ) . getByTestId ( 'info-tooltip-toggle' )
493532
494533 expect (
495534 within ( iconWrapper ) . getByTestId ( TooltipIconType . ERROR )
@@ -501,7 +540,9 @@ describe('App', () => {
501540 cliCompatible : false
502541 } )
503542
504- const iconWrapper = screen . getAllByTestId ( 'info-tooltip-toggle' ) [ 1 ]
543+ const iconWrapper = within (
544+ screen . getByTestId ( 'experiments-section-details' )
545+ ) . getByTestId ( 'info-tooltip-toggle' )
505546
506547 expect (
507548 within ( iconWrapper ) . getByTestId ( TooltipIconType . ERROR )
@@ -513,7 +554,9 @@ describe('App', () => {
513554 hasData : true
514555 } )
515556
516- const iconWrapper = screen . getAllByTestId ( 'info-tooltip-toggle' ) [ 1 ]
557+ const iconWrapper = within (
558+ screen . getByTestId ( 'experiments-section-details' )
559+ ) . getByTestId ( 'info-tooltip-toggle' )
517560
518561 expect (
519562 within ( iconWrapper ) . getByTestId ( TooltipIconType . PASSED )
@@ -571,7 +614,9 @@ describe('App', () => {
571614 cliCompatible : false
572615 } )
573616
574- const iconWrapper = screen . getAllByTestId ( 'info-tooltip-toggle' ) [ 3 ]
617+ const iconWrapper = within (
618+ screen . getByTestId ( 'studio-section-details' )
619+ ) . getByTestId ( 'info-tooltip-toggle' )
575620
576621 expect (
577622 within ( iconWrapper ) . getByTestId ( TooltipIconType . ERROR )
@@ -581,7 +626,9 @@ describe('App', () => {
581626 it ( 'should show an info icon if dvc is compatible but studio is not connected' , ( ) => {
582627 renderApp ( )
583628
584- const iconWrapper = screen . getAllByTestId ( 'info-tooltip-toggle' ) [ 3 ]
629+ const iconWrapper = within (
630+ screen . getByTestId ( 'studio-section-details' )
631+ ) . getByTestId ( 'info-tooltip-toggle' )
585632
586633 expect (
587634 within ( iconWrapper ) . getByTestId ( TooltipIconType . INFO )
@@ -622,7 +669,9 @@ describe('App', () => {
622669 isStudioConnected : true
623670 } )
624671
625- const iconWrapper = screen . getAllByTestId ( 'info-tooltip-toggle' ) [ 3 ]
672+ const iconWrapper = within (
673+ screen . getByTestId ( 'studio-section-details' )
674+ ) . getByTestId ( 'info-tooltip-toggle' )
626675
627676 expect (
628677 within ( iconWrapper ) . getByTestId ( TooltipIconType . PASSED )
0 commit comments