Skip to content

Commit 77f9268

Browse files
huqiaoliff
authored andcommitted
feat(progress):新增Progress测试用例
1 parent 46ddf84 commit 77f9268

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

test-ci/src/__tests__/progress.tsx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* @format
3+
*/
4+
5+
import 'react-native';
6+
import React from 'react';
7+
import Progress from '../lib/Progress';
8+
// Note: test renderer must be required after react-native.
9+
import renderer from 'react-test-renderer';
10+
import { run } from '../lib/Progress/svg';
11+
12+
it('Progress', () => {
13+
const component = renderer.create(
14+
<Progress
15+
progress={30}
16+
position="fixed"
17+
progressColor="#108ee9"
18+
animation={{ duration: 1000 }}
19+
xml={run}
20+
iconShow={true}
21+
size={25}
22+
progressShow={true}
23+
/>,
24+
);
25+
expect(component.root.props.progress).toBe(30);
26+
expect(component.root.props.position).toBe('fixed');
27+
expect(component.root.props.progressColor).toBe('#108ee9');
28+
expect(component.root.props.animation.duration).toBe(1000);
29+
expect(component.root.props.iconShow).toBeTruthy();
30+
expect(component.root.props.xml).toStrictEqual(run);
31+
expect(component.root.props.size).toBe(25);
32+
expect(component.root.props.progressShow).toBeTruthy();
33+
});

0 commit comments

Comments
 (0)