opensrp / opensrp-web

The OpenSRP Admin Web Interface
Apache License 2.0
6 stars 1 forks source link

Increase test coverage for branch `miecd_vietnam_branch` #65

Open FrankApiyo opened 5 years ago

FrankApiyo commented 5 years ago

Write more tests to get a better test coverage for branch miecd_vietnam_branch Specifically, tests should be written for the following components:

cc: @hmakandi @KipSigei

FrankApiyo commented 5 years ago

Blocker: when rendering components that contain <Hicharts/> using enzyme's mount, an error is thrown that looks something like this:


Highcharts error #13: www.highcharts.com/errors/13

      30 |   }
      31 |   public componentDidMount() {
    > 32 |     const chart = Highcharts.chart('chart-wrapper', {
         |                              ^
      33 |       chart: {
      34 |         type: 'line',
      35 |         width: 0.8 * window.innerWidth,

      at c.Chart.Error (node_modules/highcharts/highcharts.src.js:463:31)
      at Object.call [as fireEvent] (node_modules/highcharts/highcharts.src.js:2408:17)
      at Object.fireEvent [as error] (node_modules/highcharts/highcharts.src.js:471:17)
      at c.Chart.error [as getContainer] (node_modules/highcharts/highcharts.src.js:24221:21)
      at c.Chart.getContainer [as firstRender] (node_modules/highcharts/highcharts.src.js:25116:17)
      at c.Chart.firstRender (node_modules/highcharts/highcharts.src.js:23572:21)
      at call (node_modules/highcharts/highcharts.src.js:2408:17)
      at c.Chart.fireEvent [as init] (node_modules/highcharts/highcharts.src.js:23446:17)
      at c.Chart.init [as getArgs] (node_modules/highcharts/highcharts.src.js:23420:17)
      at new apply (node_modules/highcharts/highcharts.src.js:23359:13)
      at Object.c.chart (node_modules/highcharts/highcharts.src.js:23393:20)
      at MotherWeightChart.chart [as componentDidMount] (src/components/MotherWeightChart/index.tsx:32:30)
      at commitLifeCycles (node_modules/react-dom/cjs/react-dom.development.js:17334:22)
      at commitAllLifeCycles (node_modules/react-dom/cjs/react-dom.development.js:18736:7)
      at HTMLUnknownElement.callCallback (node_modules/react-dom/cjs/react-dom.development.js:149:14)
      at Object.invokeGuardedCallbackDev (node_modules/react-dom/cjs/react-dom.development.js:199:16)
      at invokeGuardedCallback (node_modules/react-dom/cjs/react-dom.development.js:256:31)
      at commitRoot (node_modules/react-dom/cjs/react-dom.development.js:18948:7)
      at node_modules/react-dom/cjs/react-dom.development.js:20418:5

@KipSigei I need your help with this

FrankApiyo commented 5 years ago

The components that haven't yet been tested above :point_up: all contain a <Hicharts /> component

FrankApiyo commented 5 years ago

This blocker was removed by : 57cb37a