slate-test-utils
Version:
> 📣 Love Slate and looking for your next gig? Sirona Medical is [hiring](https://sironamedical.com/about-us/careers/)!
27 lines (26 loc) • 2.58 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.findByDataEditorElement = exports.findAllByDataEditorElement = exports.getByDataEditorElement = exports.getAllByDataEditorElement = exports.queryByDataEditorElement = exports.findByDataEditorLeaf = exports.findAllByDataEditorLeaf = exports.getAllByDataEditorLeaf = exports.getByDataEditorLeaf = exports.queryAllByDataEditorLeaf = exports.queryByDataEditorLeaf = void 0;
const react_1 = require("@testing-library/react");
// The queryAllByAttribute is a shortcut for attribute-based matchers
// You can also use document.querySelector or a combination of existing
// testing library utilities to find matching nodes for your query
const queryAllByDataEditorLeaf = (...args) => react_1.queryHelpers.queryAllByAttribute('data-editor-leaf', ...args);
exports.queryAllByDataEditorLeaf = queryAllByDataEditorLeaf;
const getMultipleErrorLeaf = (c, dataValue) => `Found multiple elements with the data-editor-leaf attribute of: ${dataValue}`;
const getMissingErrorLeaf = (c, dataValue) => `Unable to find an element with the data-editor-leaf attribute of: ${dataValue}`;
const [queryByDataEditorLeaf, getAllByDataEditorLeaf, getByDataEditorLeaf, findAllByDataEditorLeaf, findByDataEditorLeaf,] = (0, react_1.buildQueries)(queryAllByDataEditorLeaf, getMultipleErrorLeaf, getMissingErrorLeaf);
exports.queryByDataEditorLeaf = queryByDataEditorLeaf;
exports.getAllByDataEditorLeaf = getAllByDataEditorLeaf;
exports.getByDataEditorLeaf = getByDataEditorLeaf;
exports.findAllByDataEditorLeaf = findAllByDataEditorLeaf;
exports.findByDataEditorLeaf = findByDataEditorLeaf;
const queryAllByDataEditorElement = (...args) => react_1.queryHelpers.queryAllByAttribute('data-editor-element', ...args);
const getMultipleErrorElement = (c, dataValue) => `Found multiple elements with the data-editor-element attribute of: ${dataValue}`;
const getMissingErrorElement = (c, dataValue) => `Unable to find an element with the data-editor-element attribute of: ${dataValue}`;
const [queryByDataEditorElement, getAllByDataEditorElement, getByDataEditorElement, findAllByDataEditorElement, findByDataEditorElement,] = (0, react_1.buildQueries)(queryAllByDataEditorElement, getMultipleErrorElement, getMissingErrorElement);
exports.queryByDataEditorElement = queryByDataEditorElement;
exports.getAllByDataEditorElement = getAllByDataEditorElement;
exports.getByDataEditorElement = getByDataEditorElement;
exports.findAllByDataEditorElement = findAllByDataEditorElement;
exports.findByDataEditorElement = findByDataEditorElement;