Skip to content

Commit

Permalink
Add tabbable mock.
Browse files Browse the repository at this point in the history
  • Loading branch information
asvinb committed Sep 27, 2022
1 parent c0f05fa commit ac764f7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions __mocks__/tabbable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const lib = jest.requireActual( 'focus-trap-react/node_modules/tabbable' );

const tabbable = {
...lib,
isFocusable: ( node, options ) =>
lib.isFocusable( node, { ...options, displayCheck: 'none' } ),
isTabbable: ( node, options ) =>
lib.isTabbable( node, { ...options, displayCheck: 'none' } ),
tabbable: ( node, options ) =>
lib.tabbable( node, { ...options, displayCheck: 'none' } ),
focusable: ( node, options ) =>
lib.focusable( node, { ...options, displayCheck: 'none' } ),
};

module.exports = tabbable;

0 comments on commit ac764f7

Please sign in to comment.