mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-14 13:46:55 +03:00
bbb1a40395
* react-base16-styling * Use inline react-base16-styling themes * Fix * Format * Fix * Fixes * Transform more * react-json-tree * Update lock * Remove unnecessary * react-dock * Move to dep * Lock * Fix * Fix * Create tame-eagles-relax.md
23 lines
620 B
TypeScript
23 lines
620 B
TypeScript
import React from 'react';
|
|
import TestRenderer from 'react-test-renderer/shallow';
|
|
|
|
import { JSONTree } from '../src/index.js';
|
|
import JSONNode from '../src/JSONNode.js';
|
|
|
|
const BASIC_DATA = { a: 1, b: 'c' };
|
|
|
|
function render(component: React.ReactElement) {
|
|
const renderer = TestRenderer.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);
|
|
});
|
|
});
|