forked from recharts/recharts
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CrossSpec.js
27 lines (22 loc) · 812 Bytes
/
CrossSpec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import React from 'react';
import { expect } from 'chai';
import { Surface, Cross } from 'recharts';
import { mount, render } from 'enzyme';
describe('<Cross />', () => {
it('Render 1 path in Cross', () => {
const wrapper = render(
<Surface width={400} height={400}>
<Cross top={50} left={50} x={150} y={180} width={200} height={200} stroke="#000" fill="none" />
</Surface>
);
expect(wrapper.find('.recharts-cross').length).to.equal(1);
});
it('Don\'t render any path when props is invalid', () => {
const wrapper = render(
<Surface width={400} height={400}>
<Cross top={50} left={50} x="x" y={180} width={200} height={200} stroke="#000" fill="none" />
</Surface>
);
expect(wrapper.find('.recharts-cross').length).to.equal(0);
});
});