@@ -187,21 +187,21 @@ function queryByAltText(...args) {
187
187
function queryAllByDisplayValue (
188
188
container ,
189
189
value ,
190
- { exact = true , collapseWhitespace = true , trim = true } = { } ,
190
+ { exact = true , collapseWhitespace, trim, normalizer } = { } ,
191
191
) {
192
192
const matcher = exact ? matches : fuzzyMatches
193
- const matchOpts = { collapseWhitespace, trim}
193
+ const matchNormalizer = makeNormalizer ( { collapseWhitespace, trim, normalizer } )
194
194
return Array . from ( container . querySelectorAll ( `input,textarea,select` ) ) . filter (
195
195
node => {
196
196
if ( node . tagName === 'SELECT' ) {
197
197
const selectedOptions = Array . from ( node . options ) . filter (
198
198
option => option . selected ,
199
199
)
200
200
return selectedOptions . some ( optionNode =>
201
- matcher ( getNodeText ( optionNode ) , optionNode , value , matchOpts ) ,
201
+ matcher ( getNodeText ( optionNode ) , optionNode , value , matchNormalizer ) ,
202
202
)
203
203
} else {
204
- return matcher ( node . value , node , value , matchOpts )
204
+ return matcher ( node . value , node , value , matchNormalizer )
205
205
}
206
206
} ,
207
207
)
0 commit comments