reBEM addons for React Test Utilities.
Install
npm i -D rebem-test-utils
Overview
In addition to usual React Test Utilities methods there are few new which lets you search for components by BEM PropTypes:
block elem mods mix
This object may be called bemjson
.
API
isCompositeComponentWithBEM(instance, bemjson)
In addition to isCompositeComponentWithType()
.
;; const tree = TestUtils; const elem = TestUtils; console;// true
scryRenderedDOMComponentsWithBEM(tree, bemjson)
In addition to scryRenderedDOMComponentsWithClass()
.
;; const tree = TestUtils; const elems = TestUtils; console;// 2 console;// true
findRenderedDOMComponentWithBEM(tree, bemjson)
In addition to findRenderedDOMComponentWithClass()
.
;; const tree = TestUtils; const elem = TestUtils; console;// true