Skip to content
Snippets Groups Projects
PieChart.spec.tsx 814 B
Newer Older
  • Learn to ignore specific revisions
  • import { DataloadState } from 'enums'
    
    import { mount } from 'enzyme'
    import toJson from 'enzyme-to-json'
    import { DataloadValueDetail } from 'models'
    import React from 'react'
    import PieChart from './PieChart'
    
    describe('PieChart component', () => {
      const mockDataloadValueDetailArray: DataloadValueDetail[] = [
        { value: 10, state: DataloadState.VALID },
        { value: 20, state: DataloadState.VALID },
        { value: 30, state: DataloadState.VALID },
      ]
      it('should be rendered correctly', () => {
        const wrapper = mount(
          <PieChart
            radius={300}
            outerRadius={300}
            innerRadius={300}
            dataloadValueDetailArray={mockDataloadValueDetailArray}
          >
            child with value and text to render
          </PieChart>
        )
        expect(toJson(wrapper)).toMatchSnapshot()
      })
    })