File tree Expand file tree Collapse file tree 1 file changed +1
-17
lines changed Expand file tree Collapse file tree 1 file changed +1
-17
lines changed Original file line number Diff line number Diff line change @@ -214,17 +214,8 @@ test.each([
214
214
} )
215
215
216
216
describe ( 'checkVisibility API integration' , ( ) => {
217
- let originalCheckVisibility
218
-
219
217
beforeEach ( ( ) => {
220
- // This may not exist depending on the environment
221
- originalCheckVisibility = Element . prototype . checkVisibility
222
- } )
223
-
224
- afterEach ( ( ) => {
225
- if ( originalCheckVisibility ) {
226
- Element . prototype . checkVisibility = originalCheckVisibility
227
- } else {
218
+ if ( Element . prototype . checkVisibility ) {
228
219
delete Element . prototype . checkVisibility
229
220
}
230
221
} )
@@ -246,9 +237,6 @@ describe('checkVisibility API integration', () => {
246
237
} )
247
238
248
239
test ( 'falls back to getComputedStyle when checkVisibility unavailable' , ( ) => {
249
- // Remove checkVisibility to test fallback
250
- delete Element . prototype . checkVisibility
251
-
252
240
const { container} = render ( '<button style="display: none;">Test</button>' )
253
241
const button = container . querySelector ( 'button' )
254
242
@@ -276,10 +264,6 @@ describe('checkVisibility API integration', () => {
276
264
const resultWithoutAPI = isInaccessible ( button2 )
277
265
278
266
expect ( resultWithAPI ) . toBe ( resultWithoutAPI )
279
-
280
- if ( originalCheckVisibility ) {
281
- Element . prototype . checkVisibility = originalCheckVisibility
282
- }
283
267
} )
284
268
} )
285
269
} )
You can’t perform that action at this time.
0 commit comments