Skip to content

Commit f1c95fb

Browse files
author
Charley
committed
test env
1 parent ef0c595 commit f1c95fb

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

src/__tests__/role-helpers.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -214,17 +214,8 @@ test.each([
214214
})
215215

216216
describe('checkVisibility API integration', () => {
217-
let originalCheckVisibility
218-
219217
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) {
228219
delete Element.prototype.checkVisibility
229220
}
230221
})
@@ -246,9 +237,6 @@ describe('checkVisibility API integration', () => {
246237
})
247238

248239
test('falls back to getComputedStyle when checkVisibility unavailable', () => {
249-
// Remove checkVisibility to test fallback
250-
delete Element.prototype.checkVisibility
251-
252240
const {container} = render('<button style="display: none;">Test</button>')
253241
const button = container.querySelector('button')
254242

@@ -276,10 +264,6 @@ describe('checkVisibility API integration', () => {
276264
const resultWithoutAPI = isInaccessible(button2)
277265

278266
expect(resultWithAPI).toBe(resultWithoutAPI)
279-
280-
if (originalCheckVisibility) {
281-
Element.prototype.checkVisibility = originalCheckVisibility
282-
}
283267
})
284268
})
285269
})

0 commit comments

Comments
 (0)