import { isOptionByValueAvailableInHandle } from '../is-option-by-value-available-in-handle' ; import { ElementHandle } from 'playwright' ; export async function areOptionsByValueAvailableInHandle ( selector , name , expectedOptionValues ) { if ( expectedOptionValues . length === 0 ) { throw new Error ( 'No option to check: you must specify at least one option' ) ; } for ( let index = 0 ; index < expectedOptionValues . length ; index ++ ) { const expectedOptionValue = expectedOptionValues [ index ] ; const isAvailable = await isOptionByValueAvailableInHandle ( selector , name , expectedOptionValue ) ; if ( ! isAvailable ) { return false ; } } return true ; }