import { render } from '@testing-library/react'; import { IconButton } from '../index'; const types = { shape: ['default', 'square'], variant: ['primary', 'secondary', 'danger', 'default'], }; Object.keys(types).forEach(type => { types[type].forEach(value => { it(`IconButton-${type}-${value}`, () => { const prop = { [type]: value }; const { asFragment } = render(hello); expect(asFragment()).toMatchSnapshot(); }); }); });