We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e69fd6b commit b12cb29Copy full SHA for b12cb29
src/queries/test-id.js
@@ -18,16 +18,12 @@ const getMissingError = (
18
{computeCloseMatches = false, ...options} = {},
19
) => {
20
const defaultMessage = `Unable to find an element by: [${getTestIdAttribute()}="${id}"]`
21
- if (!computeCloseMatches || typeof id !== 'string') {
22
- return defaultMessage
23
- }
24
-
25
- const closeMatches = getCloseMatchesByAttribute(
26
- getTestIdAttribute(),
27
- c,
28
- id,
29
- options,
30
- )
+
+ const closeMatches =
+ !computeCloseMatches || typeof id !== 'string'
+ ? []
+ : getCloseMatchesByAttribute(getTestIdAttribute(), c, id, options)
31
return closeMatches.length === 0
32
? defaultMessage
33
: `${defaultMessage}. Did you mean one of the following?\n${closeMatches.join(
0 commit comments