playwright-fluent
Version:
Fluent API around playwright
19 lines (18 loc) • 754 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.isOptionByValueAvailableInHandle = void 0;
const get_all_options_of_handle_1 = require("../get-all-options-of-handle");
async function isOptionByValueAvailableInHandle(selector, name, expectedOptionValue) {
if (selector === undefined || selector === null) {
return false;
}
const availableOptions = await (0, get_all_options_of_handle_1.getAllOptionsOfHandle)(selector, name);
const foundOption = availableOptions
.filter((option) => option.value === expectedOptionValue)
.shift();
if (foundOption) {
return true;
}
return false;
}
exports.isOptionByValueAvailableInHandle = isOptionByValueAvailableInHandle;
;