UNPKG

playwright-fluent

Version:
19 lines (18 loc) 917 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.areOptionsByValueAvailableInHandle = void 0; const is_option_by_value_available_in_handle_1 = require("../is-option-by-value-available-in-handle"); 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 (0, is_option_by_value_available_in_handle_1.isOptionByValueAvailableInHandle)(selector, name, expectedOptionValue); if (!isAvailable) { return false; } } return true; } exports.areOptionsByValueAvailableInHandle = areOptionsByValueAvailableInHandle;