summaryrefslogtreecommitdiffstats
path: root/frontend/__tests__/SingleItem.test.js
blob: 3fe3943a87435a10b2b21836c2973d9735cd5b1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import React from 'react';
import { mount } from 'enzyme';
import wait from 'waait';
import toJSON from 'enzyme-to-json';
import SingleItem from '../components/SingleItem';
import mountOptions from './mockMang';

describe('<SingleItem/>', () => {
  it('Renders with Proper Data', async () => {
    const wrapper = mount(<SingleItem id="123" />, mountOptions);
    await wait();
    wrapper.update();

    const Item = wrapper.find('[data-test="SingleItem"]');
    expect(toJSON(Item)).toMatchSnapshot();
  });

  xit('Errors with a not found Item', async () => {
    const wrapper = mount(<SingleItem id="123" />, mountOptions);
  });
});