UNPKG

mitragyna

Version:

A library for managing ActiveResources as React components

43 lines (31 loc) 927 B
import React, { PureComponent } from 'react'; import { Field } from '../build/mitragyna.min'; import axios from 'axios'; import library from './support/resourceLibrary'; import orderFixture from './support/fixtures/orders/find.json'; describe('Field', () => { let wrapper; let order; beforeEach(async () => { axios._setMockResponses({ '/orders/:id/': { status: 200, data: orderFixture }, }); order = await library.Order.find('1'); let props = { component: class extends PureComponent { render() { return <section> <Input type="text" name="quantity"></Input> </section> } }, subject: order }; wrapper = shallow(<Field {...props}></Field>); }); describe('classNames', () => { }); it('renders component prop', () => { expect(wrapper).toContainReact(<Input type="text" name="quantity"></Input>); }); });