enzyme test for map function in react code example
Example: get value in maps loop using enzym
describe('<CatsTable />', () => {
const wrapper = mount(
<CatsTable cats={cats} />
);
it('renders child correctly', () => {
expect(wrapper.find('tbody').children()).to.have.length(cats.length);
expect(wrapper.find('tbody').children().find('tr')).to.have.length(cats.length);
});