digitransit-ui/test/unit/component/IconWithIcon.test.js
2025-11-24 14:43:24 +02:00

19 lines
583 B
JavaScript

import React from 'react';
import { shallowWithIntl } from '../helpers/mock-intl-enzyme';
import Icon from '../../../app/component/Icon';
import IconWithIcon from '../../../app/component/IconWithIcon';
describe('<IconWithIcon />', () => {
it('should apply the given sub icon shape', () => {
const props = {
img: 'img',
subIcon: 'sub-img',
subIconShape: 'circle',
};
const wrapper = shallowWithIntl(<IconWithIcon {...props} />);
expect(
wrapper.find(Icon).at(1).prop('background').props.backgroundShape,
).to.equal('circle');
});
});