Skip to content

Commit b754a70

Browse files
committed
add test
1 parent 1f1be61 commit b754a70

File tree

2 files changed

+155
-0
lines changed

2 files changed

+155
-0
lines changed

tests/__snapshots__/index.spec.js.snap

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,147 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3+
exports[` 1`] = `
4+
Array [
5+
<Line
6+
className=""
7+
percent={20}
8+
prefixCls="rc-progress"
9+
strokeColor="#2db7f5"
10+
strokeLinecap="butt"
11+
strokeWidth={1}
12+
style={Object {}}
13+
trailColor="#D9D9D9"
14+
trailWidth={1}
15+
>
16+
<svg
17+
className="rc-progress-line"
18+
preserveAspectRatio="none"
19+
style={Object {}}
20+
viewBox="0 0 100 1"
21+
>
22+
<path
23+
className="rc-progress-line-trail"
24+
d="M 0,0.5
25+
L 100,0.5"
26+
fillOpacity="0"
27+
stroke="#D9D9D9"
28+
strokeLinecap="butt"
29+
strokeWidth={1}
30+
/>
31+
<path
32+
className="rc-progress-line-path"
33+
d="M 0,0.5
34+
L 100,0.5"
35+
fillOpacity="0"
36+
key="0"
37+
stroke="#2db7f5"
38+
strokeLinecap="butt"
39+
strokeWidth={1}
40+
style={
41+
Object {
42+
"strokeDasharray": "20px, 100px",
43+
"strokeDashoffset": "-0px",
44+
"transition": "stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear",
45+
}
46+
}
47+
/>
48+
</svg>
49+
</Line>,
50+
<br />,
51+
<Line
52+
className=""
53+
percent={20}
54+
prefixCls="rc-progress"
55+
strokeColor="#2db7f5"
56+
strokeLinecap="round"
57+
strokeWidth={1}
58+
style={Object {}}
59+
trailColor="#D9D9D9"
60+
trailWidth={1}
61+
>
62+
<svg
63+
className="rc-progress-line"
64+
preserveAspectRatio="none"
65+
style={Object {}}
66+
viewBox="0 0 100 1"
67+
>
68+
<path
69+
className="rc-progress-line-trail"
70+
d="M 0.5,0.5
71+
L 99.5,0.5"
72+
fillOpacity="0"
73+
stroke="#D9D9D9"
74+
strokeLinecap="round"
75+
strokeWidth={1}
76+
/>
77+
<path
78+
className="rc-progress-line-path"
79+
d="M 0.5,0.5
80+
L 99.5,0.5"
81+
fillOpacity="0"
82+
key="0"
83+
stroke="#2db7f5"
84+
strokeLinecap="round"
85+
strokeWidth={1}
86+
style={
87+
Object {
88+
"strokeDasharray": "19.8px, 100px",
89+
"strokeDashoffset": "-0px",
90+
"transition": "stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear",
91+
}
92+
}
93+
/>
94+
</svg>
95+
</Line>,
96+
<br />,
97+
<Line
98+
className=""
99+
percent={20}
100+
prefixCls="rc-progress"
101+
strokeColor="#2db7f5"
102+
strokeLinecap="square"
103+
strokeWidth={1}
104+
style={Object {}}
105+
trailColor="#D9D9D9"
106+
trailWidth={1}
107+
>
108+
<svg
109+
className="rc-progress-line"
110+
preserveAspectRatio="none"
111+
style={Object {}}
112+
viewBox="0 0 100 1"
113+
>
114+
<path
115+
className="rc-progress-line-trail"
116+
d="M 0,0.5
117+
L 100,0.5"
118+
fillOpacity="0"
119+
stroke="#D9D9D9"
120+
strokeLinecap="square"
121+
strokeWidth={1}
122+
/>
123+
<path
124+
className="rc-progress-line-path"
125+
d="M 0,0.5
126+
L 100,0.5"
127+
fillOpacity="0"
128+
key="0"
129+
stroke="#2db7f5"
130+
strokeLinecap="square"
131+
strokeWidth={1}
132+
style={
133+
Object {
134+
"strokeDasharray": "19.9px, 100px",
135+
"strokeDashoffset": "-0px",
136+
"transition": "stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear",
137+
}
138+
}
139+
/>
140+
</svg>
141+
</Line>,
142+
]
143+
`;
144+
3145
exports[`Progress Circle should show right gapPosition 1`] = `
4146
Array [
5147
<Circle

tests/index.spec.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ describe('Progress', () => {
2626
});
2727
});
2828

29+
describe('Diff Line', () => {
30+
const wrapper = mount(
31+
<>
32+
<Line percent={20} strokeLinecap="butt" />
33+
<br/>
34+
<Line percent={20} strokeLinecap="round" />
35+
<br/>
36+
<Line percent={20} strokeLinecap="square" />
37+
</>
38+
);
39+
expect(wrapper).toMatchSnapshot();
40+
})
41+
2942
describe('Circle', () => {
3043
it('change with animation', () => {
3144
class Demo extends React.Component {

0 commit comments

Comments
 (0)