placeholder-text.js 1.7 KB

123456789101112131415161718192021222324252627282930313233
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.findByPlaceholderText = exports.findAllByPlaceholderText = exports.getAllByPlaceholderText = exports.getByPlaceholderText = exports.queryAllByPlaceholderText = exports.queryByPlaceholderText = void 0;
  6. var _queryHelpers = require("../query-helpers");
  7. var _helpers = require("../helpers");
  8. var _allUtils = require("./all-utils");
  9. const queryAllByPlaceholderText = (...args) => {
  10. (0, _helpers.checkContainerType)(args[0]); // TODO: Remove ignore after `queryAllByAttribute` will be moved to TS
  11. // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  12. // @ts-expect-error
  13. return (0, _allUtils.queryAllByAttribute)('placeholder', ...args);
  14. };
  15. const getMultipleError = (c, text) => `Found multiple elements with the placeholder text of: ${text}`;
  16. const getMissingError = (c, text) => `Unable to find an element with the placeholder text of: ${text}`;
  17. const queryAllByPlaceholderTextWithSuggestions = (0, _queryHelpers.wrapAllByQueryWithSuggestion)(queryAllByPlaceholderText, queryAllByPlaceholderText.name, 'queryAll');
  18. exports.queryAllByPlaceholderText = queryAllByPlaceholderTextWithSuggestions;
  19. const [queryByPlaceholderText, getAllByPlaceholderText, getByPlaceholderText, findAllByPlaceholderText, findByPlaceholderText] = (0, _allUtils.buildQueries)(queryAllByPlaceholderText, getMultipleError, getMissingError);
  20. exports.findByPlaceholderText = findByPlaceholderText;
  21. exports.findAllByPlaceholderText = findAllByPlaceholderText;
  22. exports.getByPlaceholderText = getByPlaceholderText;
  23. exports.getAllByPlaceholderText = getAllByPlaceholderText;
  24. exports.queryByPlaceholderText = queryByPlaceholderText;