import React from 'react';
import { BrowserRouter } from 'react-router-dom';
import TestRenderer from 'react-test-renderer';
import { DndProvider } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';
import { GridItem } from '../../src/js/components/GridItem';
import state from '../state';
jest.mock('react-redux', () => ({
useSelector: jest.fn(),
useDispatch: () => jest.fn(),
useDrag: 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 = TestRenderer.create(
).toJSON();
expect(result).toMatchSnapshot();
});
it('should handle artist', () => {
const result = TestRenderer.create(
).toJSON();
expect(result).toMatchSnapshot();
});
it('should handle playlist', () => {
const result = TestRenderer.create(
).toJSON();
expect(result).toMatchSnapshot();
});
});