@@ -97,15 +97,7 @@ cases(
97
97
} ,
98
98
)
99
99
100
- test . each ( [
101
- [ 'getByLabelText' ] ,
102
- [ 'getByPlaceholderText' ] ,
103
- [ 'getByText' ] ,
104
- [ 'getByAltText' ] ,
105
- [ 'getByTitle' ] ,
106
- [ 'getByRole' ] ,
107
- [ 'getByTestId' ] ,
108
- ] ) (
100
+ test . each ( [ [ 'getByText' ] , [ 'getByLabelText' ] ] ) (
109
101
'%s query will print the playground link when enabled in the config' ,
110
102
query => {
111
103
configure ( { printPlaygroundLink : true } )
@@ -114,15 +106,7 @@ test.each([
114
106
} ,
115
107
)
116
108
117
- test . each ( [
118
- [ 'getByLabelText' ] ,
119
- [ 'getByPlaceholderText' ] ,
120
- [ 'getByText' ] ,
121
- [ 'getByAltText' ] ,
122
- [ 'getByTitle' ] ,
123
- [ 'getByRole' ] ,
124
- [ 'getByTestId' ] ,
125
- ] ) (
109
+ test . each ( [ [ 'getByText' ] , [ 'getByLabelText' ] ] ) (
126
110
'%s query will NOT print the playground link when disabled in the config' ,
127
111
query => {
128
112
configure ( { printPlaygroundLink : false } )
@@ -131,6 +115,15 @@ test.each([
131
115
} ,
132
116
)
133
117
118
+ test . each ( [ [ 'getByText' ] , [ 'getByLabelText' ] ] ) (
119
+ '%s query will NOT print the playground link when element has no children' ,
120
+ query => {
121
+ configure ( { printPlaygroundLink : true } )
122
+ document . body . innerHTML = ''
123
+ expect ( ( ) => screen [ query ] ( 'TEST QUERY' ) ) . not . toThrowError ( / p l a y g r o u n d / i)
124
+ } ,
125
+ )
126
+
134
127
describe ( '*ByDisplayValue queries throw an error when there are multiple elements returned' , ( ) => {
135
128
test ( 'getByDisplayValue' , ( ) => {
136
129
const { getByDisplayValue} = render (
0 commit comments