Skip to content

Commit 33e836d

Browse files
fix: added expected to matcher toHaveFocus (#66)
1 parent 86ee9b1 commit 33e836d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/to-have-focus.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {matcherHint, printReceived} from 'jest-matcher-utils'
1+
import {matcherHint, printReceived, printExpected} from 'jest-matcher-utils'
22
import {checkHtmlElement} from './utils'
33

44
export function toHaveFocus(element) {
@@ -10,6 +10,8 @@ export function toHaveFocus(element) {
1010
return [
1111
matcherHint(`${this.isNot ? '.not' : ''}.toHaveFocus`, 'element', ''),
1212
'',
13+
'Expected',
14+
` ${printExpected(element)}`,
1315
'Received:',
1416
` ${printReceived(element.ownerDocument.activeElement)}`,
1517
].join('\n')

0 commit comments

Comments
 (0)