tin-react-components
Version:
All components used for Omadi apps
17 lines (16 loc) • 483 B
JavaScript
import React from 'react'
import { mount } from 'enzyme'
import { expect } from 'chai'
import sinon from 'sinon'
import Tree from '../index'
import treeModel from './model.json'
/**
* @author: Jason Baddley
*/
describe('<Tree />', () => {
const onClick = sinon.spy()
it('should show a node per key in object', () => {
const wrapper = mount(<Tree onClick={onClick} data={treeModel} />)
expect(wrapper.find('.node')).to.have.length(Object.keys(treeModel).length)
})
})