mistadikay
3/10/2016 - 6:32 AM

medium-rebem-7-1.js

import { shallow } from 'rebem-enzyme';
import Popup from '../components/popup';

const wrapper = shallow(<Popup />);

console.log(
    wrapper.findBEM({ block: 'popup', elem: 'content' }).length
);
// 1
import {
    renderIntoDocument,
    findRenderedDOMComponentWithBEM,
    isDOMComponent
} from 'rebem-test-utils';
import Popup from '../components/popup';

const tree = renderIntoDocument(<Popup />);
const overlay = findRenderedDOMComponentWithBEM(tree, { block: 'popup', elem: 'overlay' });

console.log(
    isDOMComponent(overlay)
);
// true