Skip to content

Commit 7163a45

Browse files
raju249AutomatedTester
authored andcommitted
Add fetch and tests for Ring [skip ci]
1 parent 18b449f commit 7163a45

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from 'react';
2+
import { shallow, mount } from 'enzyme';
3+
import Ring from '../components/RingSystem/Ring/Ring';
4+
5+
test('Ring component', () => {
6+
let parentFunc = function() {
7+
console.log('Dummy parent func');
8+
}
9+
10+
const ring = shallow(<Ring
11+
radius={2}
12+
stroke={1}
13+
id={'2'}
14+
color={'#00000'}
15+
progress={10}
16+
offset={1}
17+
parentCB={parentFunc}
18+
label={'random label'}
19+
/>)
20+
21+
const props = ring.getElements()[0].props.children.props.children.props;
22+
const circle = props.children[0].props;
23+
24+
expect(parseInt(props.id)).toEqual(2);
25+
expect(parseInt(props.height)).toEqual(4);
26+
expect(parseInt(props.width)).toEqual(4);
27+
});

0 commit comments

Comments
 (0)