redux-devtools/packages/react-json-tree/test/index.spec.js
Mihail Diordiev b80cc9e5b9
Merge react-json-tree package (#428)
* Merge react-json-tree from alexkuz/react-json-tree

* Npm package config

* Add credits

* Stick `eslint-plugin-react` to `7.4.0` till change deprecated `componentWillReceiveProps`
2018-12-21 21:18:05 +02:00

24 lines
612 B
JavaScript

import React from 'react';
import expect from 'expect';
import { createRenderer } from 'react-test-renderer/shallow';
import JSONTree from '../src/index';
import JSONNode from '../src/JSONNode';
const BASIC_DATA = { a: 1, b: 'c' };
function render(component) {
const renderer = createRenderer();
renderer.render(component);
return renderer.getRenderOutput();
}
describe('JSONTree', () => {
it('should render basic tree', () => {
const result = render(<JSONTree data={BASIC_DATA} />);
expect(result.type).toBe('ul');
expect(result.props.children.type.name).toBe(JSONNode.name);
});
});