Skip to content

Commit 66f2206

Browse files
pwolaqeps1lon
authored andcommitted
test: fix focus test (#147)
1 parent c50c0bb commit 66f2206

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/__tests__/to-have-focus.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {render} from './helpers/test-utils'
2+
import document from './helpers/document'
23

34
test('.toHaveFocus', () => {
45
const {container} = render(`
@@ -11,6 +12,7 @@ test('.toHaveFocus', () => {
1112
const focused = container.querySelector('#focused')
1213
const notFocused = container.querySelector('#not-focused')
1314

15+
document.body.appendChild(container)
1416
focused.focus()
1517

1618
expect(focused).toHaveFocus()

0 commit comments

Comments
 (0)