import React from 'react';
import { BarStack } from '../src';
import { shallow } from 'enzyme';

describe('<BarStack />', () => {
  test('it should be defined', () => {
    expect(BarStack).toBeDefined()
  })

  test('it should have className .vx-bar-stack', () => {
    const wrapper = shallow(
      <BarStack
        data={[]}
        top={2}
        left={3}
        x={d => d}
        xScale={d => d}
        yScale={d => d}
        zScale={d => d}
        keys={[]}
      />
    )
    expect(wrapper.prop('className')).toEqual('vx-bar-stack')
  })

  test('it should set className prop', () => {
    const wrapper = shallow(
      <BarStack
        className='test'
        data={[]}
        top={2}
        left={3}
        x={d => d}
        xScale={d => d}
        yScale={d => d}
        zScale={d => d}
        keys={[]}
      />
    )
    expect(wrapper.prop('className')).toEqual('vx-bar-stack test')
  })

  test('it should set top & left props', () => {
    const wrapper = shallow(
      <BarStack
        className='test'
        data={[]}
        top={2}
        left={3}
        x={d => d}
        xScale={d => d}
        yScale={d => d}
        zScale={d => d}
        keys={[]}
      />
    )
    expect(wrapper.prop('top')).toEqual(2)
    expect(wrapper.prop('left')).toEqual(3)
  })
})
@@ -90,16 +90,164 @@
 zyme';%0A%0A
+const xScale = jest.fn();%0AxScale.bandwidth = jest.fn();%0AxScale.step = jest.fn();%0AxScale.paddingInner = jest.fn();%0AxScale.paddingOuter = jest.fn();%0A%0A
 describe
@@ -344,21 +344,23 @@
 efined()
+;
 %0A  %7D)
+;
 %0A%0A  test
@@ -533,38 +533,38 @@
         xScale=%7B
-d =%3E d
+xScale
 %7D%0A        yScale
@@ -615,38 +615,40 @@
 ys=%7B%5B%5D%7D%0A      /%3E
+,
 %0A    )
+;
 %0A    expect(wrap
@@ -693,21 +693,23 @@
 -stack')
+;
 %0A  %7D)
+;
 %0A%0A  test
@@ -804,38 +804,38 @@
       className=
-'
+%22
 test
-'
+%22
 %0A        data=%7B%5B
@@ -897,38 +897,38 @@
         xScale=%7B
-d =%3E d
+xScale
 %7D%0A        yScale
@@ -979,38 +979,40 @@
 ys=%7B%5B%5D%7D%0A      /%3E
+,
 %0A    )
+;
 %0A    expect(wrap
@@ -1062,21 +1062,23 @@
 k test')
+;
 %0A  %7D)
+;
 %0A%0A  test
@@ -1187,14 +1187,14 @@
 ame=
-'
+%22
 test
-'
+%22
 %0A   
@@ -1272,30 +1272,30 @@
     xScale=%7B
-d =%3E d
+xScale
 %7D%0A        yS
@@ -1358,22 +1358,24 @@
       /%3E
+,
 %0A    )
+;
 %0A    exp
@@ -1409,16 +1409,17 @@
 Equal(2)
+;
 %0A    exp
@@ -1458,12 +1458,16 @@
 l(3)
+;
 %0A  %7D)
+;
 %0A%7D)
+;%0A

fix barstack.test.js