import React from 'react'; import { GridItem } from '../../src/js/components/GridItem'; import { render } from '../test-wrapper'; import state from '../state'; jest.mock('react-redux', () => ({ useSelector: jest.fn(), useDispatch: jest.fn(), })); jest.mock('react-router-dom', () => ({ ...jest.requireActual('react-router-dom'), useHistory: () => ({ location: { pathname: 'iris.local:6680/iris/artist/123:abc', }, }), useLocation: () => ({ pathname: 'iris.local:6680/iris/artist/123:abc', }), })); describe('', () => { const { core: { items } } = state; it('should handle album', () => { const result = render( ).toJSON(); expect(result).toMatchSnapshot(); }); it('should handle artist', () => { const result = render( ).toJSON(); expect(result).toMatchSnapshot(); }); it('should handle playlist', () => { const result = render( ).toJSON(); expect(result).toMatchSnapshot(); }); });