@@ -361,28 +361,31 @@ describe('Multiple Connections Sidebar Component', function () {
361361 it ( 'should render the only connected connections when toggled' , async ( ) => {
362362 await renderAndWaitForNavigationTree ( ) ;
363363
364+ const favoriteConnectionId = savedFavoriteConnection . id ;
365+ const recentConnectionId = savedRecentConnection . id ;
366+
364367 const activeConnectionsToggleButton = screen . getByLabelText (
365368 'Showing all connections'
366369 ) ;
367370
368- expectElementByTestId ( savedFavoriteConnection . id , 'visible' ) ;
369- expectElementByTestId ( savedRecentConnection . id , 'visible' ) ;
371+ expect ( screen . queryByTestId ( favoriteConnectionId ) ) . to . be . visible ;
372+ expect ( screen . queryByTestId ( recentConnectionId ) ) . to . be . visible ;
370373
371374 userEvent . click ( activeConnectionsToggleButton ) ;
372375 expect ( activeConnectionsToggleButton . ariaLabel ) . equals (
373376 'Showing active connections'
374377 ) ;
375378
376- expectElementByTestId ( savedFavoriteConnection . id , 'missing' ) ;
377- expectElementByTestId ( savedRecentConnection . id , 'missing' ) ;
379+ expect ( screen . queryByTestId ( favoriteConnectionId ) ) . to . be . null ;
380+ expect ( screen . queryByTestId ( recentConnectionId ) ) . to . be . null ;
378381
379382 await connectAndNotifyInstanceManager ( savedFavoriteConnection ) ;
380- expectElementByTestId ( savedFavoriteConnection . id , 'visible' ) ;
381- expectElementByTestId ( savedRecentConnection . id , 'missing' ) ;
383+ expect ( screen . queryByTestId ( favoriteConnectionId ) ) . to . be . visible ;
384+ expect ( screen . queryByTestId ( recentConnectionId ) ) . to . be . null ;
382385
383386 await connectAndNotifyInstanceManager ( savedRecentConnection ) ;
384- expectElementByTestId ( savedFavoriteConnection . id , 'visible' ) ;
385- expectElementByTestId ( savedRecentConnection . id , 'visible' ) ;
387+ expect ( screen . queryByTestId ( favoriteConnectionId ) ) . to . be . visible ;
388+ expect ( screen . queryByTestId ( recentConnectionId ) ) . to . be . visible ;
386389 } ) ;
387390
388391 context ( 'and performing actions' , function ( ) {
0 commit comments