rescript-dom-testing-library
Version:
ReScript bindings for @testing-library/dom
74 lines (63 loc) • 2.24 kB
JavaScript
// Generated by ReScript, PLEASE EDIT WITH CARE
;
var Belt_Option = require("rescript/lib/js/belt_Option.js");
var Js_undefined = require("rescript/lib/js/js_undefined.js");
var Dom = require("@testing-library/dom");
function makeByRoleOptions(exact, selector, name, param) {
return {
NAME: "WithString",
VAL: {
name: Js_undefined.fromOption(name),
selector: Js_undefined.fromOption(selector),
exact: Js_undefined.fromOption(exact)
}
};
}
function makeByRoleOptionsWithRegex(exact, selector, name, param) {
return {
NAME: "WithRegExp",
VAL: {
name: Js_undefined.fromOption(name),
selector: Js_undefined.fromOption(selector),
exact: Js_undefined.fromOption(exact)
}
};
}
function makeByRoleOptionsWithFunction(exact, selector, name, param) {
return {
NAME: "WithFunction",
VAL: {
name: Js_undefined.fromOption(name),
selector: Js_undefined.fromOption(selector),
exact: Js_undefined.fromOption(exact)
}
};
}
function getByRole(options, matcher, element) {
var options$1 = Belt_Option.getWithDefault(options, {
NAME: "NoOptions",
VAL: undefined
});
return Dom.getByRole(element, matcher.VAL, options$1.VAL);
}
function findByRole(options, matcher, element) {
return Dom.findByRole(element, matcher.VAL, options);
}
function getAllByRole(options, matcher, element) {
return Dom.getAllByRole(element, matcher.VAL, options);
}
function queryAllByRole(options, matcher, element) {
return Dom.queryAllByRole(element, matcher.VAL, options);
}
function findAllByRole(options, matcher, element) {
return Dom.findAllByRole(element, matcher.VAL, options);
}
exports.makeByRoleOptions = makeByRoleOptions;
exports.makeByRoleOptionsWithRegex = makeByRoleOptionsWithRegex;
exports.makeByRoleOptionsWithFunction = makeByRoleOptionsWithFunction;
exports.getByRole = getByRole;
exports.findByRole = findByRole;
exports.getAllByRole = getAllByRole;
exports.queryAllByRole = queryAllByRole;
exports.findAllByRole = findAllByRole;
/* @testing-library/dom Not a pure module */