import { expect } from 'chai' ; import { ActivityBar } from 'vscode-extension-tester' ; describe ( 'Activity Bar Example Tests' , ( ) => { let activityBar ; before ( async ( ) => { activityBar = new ActivityBar ( ) ; } ) ; it ( 'Shows explorer view control (container)' , async ( ) => { const controls = await activityBar . getViewControls ( ) ; expect ( controls ) . not . empty ; const titles = await Promise . all ( controls . map ( async ( control ) => { return control . getTitle ( ) ; } ) ) ; expect ( titles . some ( title => title . startsWith ( 'Explorer' ) ) ) . is . true ; } ) ; it ( 'Get a view control and open its associated view' , async ( ) => { const ctrl = await activityBar . getViewControl ( 'Explorer' ) ; const view = await ctrl ?. openView ( ) ; expect ( view ) . is . not . undefined ; expect ( await view ?. isDisplayed ( ) ) . is . true ; } ) ; ( process . platform === 'darwin' ? it . skip : it ) ( 'Manipulate the Global Actions' , async ( ) => { const manage = await activityBar . getGlobalAction ( 'Manage' ) ; const menu = await manage ?. openActionMenu ( ) ; await menu ?. close ( ) ; } ) ; } ) ;