1 | import * as React from 'react';
|
2 | import render from '../../_utils/tests/render';
|
3 | import Icon from '../Icon';
|
4 | import { Size } from '../../types';
|
5 |
|
6 | it('renders correctly for a basic icon', () => {
|
7 | const { container } = render(<Icon a11yLabel="Settings" icon="info-circle" />);
|
8 | expect(container.firstChild).toMatchSnapshot();
|
9 | });
|
10 |
|
11 | describe('colors', () => {
|
12 | ['danger', 'success', 'warning', 'primary'].forEach(color => {
|
13 | it(`renders correctly for an icon with color ${color}`, () => {
|
14 | const { container } = render(<Icon a11yLabel="Settings" color={color} icon="info-circle" />);
|
15 | expect(container.firstChild).toMatchSnapshot();
|
16 | });
|
17 | });
|
18 | });
|
19 |
|
20 | describe('sizes', () => {
|
21 | ['100', '200', '300', '400', '500', '600', '700', '800', '900'].forEach(size => {
|
22 | it(`renders correctly for an icon with size ${size}`, () => {
|
23 | const { container } = render(<Icon a11yLabel="Settings" size={size as Size} icon="info-circle" />);
|
24 | expect(container.firstChild).toMatchSnapshot();
|
25 | });
|
26 | });
|
27 | });
|