admin-on-rest-fr05t1k
Version:
A frontend Framework for building admin applications on top of REST services, using ES6, React and Material UI
14 lines (11 loc) • 444 B
JavaScript
import React from 'react';
import assert from 'assert';
import { shallow } from 'enzyme';
import FunctionField from './FunctionField';
describe('<FunctionField />', () => {
it('should render using the render function', () => {
const record = { foo: 'bar' };
const wrapper = shallow(<FunctionField record={record} render={r => r['foo'].substr(0,2)} />);
assert.equal(wrapper.html(), '<span>ba</span>');
});
});