UNPKG

1.02 kBTypeScriptView Raw
1import * as React from 'react';
2import render from '../../_utils/tests/render';
3import Icon from '../Icon';
4import { Size } from '../../types';
5
6it('renders correctly for a basic icon', () => {
7 const { container } = render(<Icon a11yLabel="Settings" icon="info-circle" />);
8 expect(container.firstChild).toMatchSnapshot();
9});
10
11describe('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
20describe('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});