import React from 'react'; import { Icon } from '../../dist/offline'; import renderer from 'react-test-renderer'; describe('Empty icon', () => { test('basic test', () => { const component = renderer.create(); const tree = component.toJSON(); expect(tree).toMatchObject({ type: 'span', props: {}, children: null, }); }); test('with child node', () => { const component = renderer.create( ); const tree = component.toJSON(); expect(tree).toMatchObject({ type: 'i', props: {}, children: null, }); }); test('with text child node', () => { const component = renderer.create(icon); const tree = component.toJSON(); expect(tree).toMatch('icon'); }); test('with multiple childen', () => { const component = renderer.create( Home ); const tree = component.toJSON(); expect(tree).toMatchObject([ { type: 'i', props: {}, children: null, }, 'Home', ]); }); });