summaryrefslogtreecommitdiffstats
path: root/frontend/__tests__/SingleItem.test.js
blob: ade9727985ba774fda4c5ae0ed7a3e1e12b83fc8 (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();
  });

  it('Errors with a not found Item', async () => {
    expect('wes').toBe('able to replicate an error');
  });
});