@@ -71,20 +71,23 @@ const queryAllByLabelText: AllByText = (
71
71
if (
72
72
matcher ( label . content , label . formControl , text , matchNormalizer ) &&
73
73
label . formControl
74
- )
74
+ ) {
75
75
labelledElements . push ( label . formControl )
76
+ }
76
77
} )
77
78
const labelsValue = labelList
78
79
. filter ( label => Boolean ( label . content ) )
79
80
. map ( label => label . content )
80
81
if (
81
82
matcher ( labelsValue . join ( ' ' ) , labelledElement , text , matchNormalizer )
82
- )
83
+ ) {
83
84
labelledElements . push ( labelledElement )
85
+ }
84
86
if ( labelsValue . length > 1 ) {
85
87
labelsValue . forEach ( ( labelValue , index ) => {
86
- if ( matcher ( labelValue , labelledElement , text , matchNormalizer ) )
88
+ if ( matcher ( labelValue , labelledElement , text , matchNormalizer ) ) {
87
89
labelledElements . push ( labelledElement )
90
+ }
88
91
89
92
const labelsFiltered = [ ...labelsValue ]
90
93
labelsFiltered . splice ( index , 1 )
@@ -97,8 +100,9 @@ const queryAllByLabelText: AllByText = (
97
100
text ,
98
101
matchNormalizer ,
99
102
)
100
- )
103
+ ) {
101
104
labelledElements . push ( labelledElement )
105
+ }
102
106
}
103
107
} )
104
108
}
0 commit comments