Skip to content

Commit

Permalink
pref: use flatMap to build query list
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Aug 26, 2023
1 parent a36ed51 commit f59aa34
Showing 1 changed file with 18 additions and 49 deletions.
67 changes: 18 additions & 49 deletions src/queries.js
Original file line number Diff line number Diff line change
@@ -1,53 +1,22 @@
let theQueries = [
"findAllByLabelText",
"findByLabelText",
"getAllByLabelText",
"getByLabelText",
"queryAllByLabelText",
"queryByLabelText",
"findAllByPlaceholderText",
"findByPlaceholderText",
"getAllByPlaceholderText",
"getByPlaceholderText",
"queryAllByPlaceholderText",
"queryByPlaceholderText",
"findAllByText",
"findByText",
"getAllByText",
"getByText",
"queryAllByText",
"queryByText",
"findAllByDisplayValue",
"findByDisplayValue",
"getAllByDisplayValue",
"getByDisplayValue",
"queryAllByDisplayValue",
"queryByDisplayValue",
"findAllByAltText",
"findByAltText",
"getAllByAltText",
"getByAltText",
"queryAllByAltText",
"queryByAltText",
"findAllByTitle",
"findByTitle",
"getAllByTitle",
"getByTitle",
"queryAllByTitle",
"queryByTitle",
"findAllByRole",
"findByRole",
"getAllByRole",
"getByRole",
"queryAllByRole",
"queryByRole",
"findAllByTestId",
"findByTestId",
"getAllByTestId",
"getByTestId",
"queryAllByTestId",
"queryByTestId",
];
"findAllBy",
"findBy",
"getAllBy",
"getBy",
"queryAllBy",
"queryBy",
].flatMap((prefix) =>
[
"AltText",
"DisplayValue",
"LabelText",
"PlaceholderText",
"Role",
"TestId",
"Text",
"Title",
].map((element) => `${prefix}${element}`)
);

(() => {
try {
Expand Down

0 comments on commit f59aa34

Please sign in to comment.