/** * NoItems component */ import React from 'react'; import { shallow } from 'enzyme'; import NoItems from '../../../src/webui/src/components/NoItems'; console.error = jest.fn(); describe(' component', () => { it('should give error for the required fields', () => { shallow(); expect(console.error).toBeCalled(); }); it('should set html from props', () => { const props = { text: 'This is a test string' }; const wrapper = shallow(); expect(wrapper.find('h2').text()).toEqual('This is a test string'); }); });