playwright-fluent
Version:
Fluent API around playwright
19 lines (18 loc) • 726 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.isOptionAvailableInHandle = void 0;
const get_all_options_of_handle_1 = require("../get-all-options-of-handle");
async function isOptionAvailableInHandle(selector, name, expectedOptionLabel) {
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.label === expectedOptionLabel)
.shift();
if (foundOption) {
return true;
}
return false;
}
exports.isOptionAvailableInHandle = isOptionAvailableInHandle;
;