Skip to content

Commit 1fa9f5f

Browse files
committed
fix tests
1 parent 324c5fc commit 1fa9f5f

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

tests/index.js

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import ReactDom from 'react-dom';
33
import expect from 'expect.js';
44
import BannerAnim from '../index';
55
import '../assets/index.less';
6+
import '../examples/assets/index.less';
67
import TestUtils from 'react-addons-test-utils';
78

89
const { Element } = BannerAnim;
9-
10+
const BgElement = Element.BgElement;
1011
describe('rc-banner-anim', () => {
1112
let div;
1213

@@ -19,10 +20,28 @@ describe('rc-banner-anim', () => {
1920
render() {
2021
return (
2122
<BannerAnim { ...props }>
22-
<Element img="https://os.alipayobjects.com/rmsportal/IhCNTqPpLeTNnwr.jpg" key="a" id="a">
23+
<Element key="a" id="a">
24+
<BgElement
25+
key="bgElem"
26+
className="bg"
27+
style={{
28+
backgroundImage: 'url(https://os.alipayobjects.com/rmsportal/uaQVvDrCwryVlbb.jpg)',
29+
backgroundSize: 'cover',
30+
backgroundPosition: 'center',
31+
}}
32+
/>
2333
<span>test text</span>
2434
</Element>
25-
<Element img="https://os.alipayobjects.com/rmsportal/uaQVvDrCwryVlbb.jpg" key="b" id="b">
35+
<Element key="b" id="b">
36+
<BgElement
37+
key="bgElem"
38+
className="bg"
39+
style={{
40+
backgroundImage: 'url(https://os.alipayobjects.com/rmsportal/IhCNTqPpLeTNnwr.jpg)',
41+
backgroundSize: 'cover',
42+
backgroundPosition: 'center',
43+
}}
44+
/>
2645
<span>test text</span>
2746
</Element>
2847
</BannerAnim>
@@ -83,6 +102,6 @@ describe('rc-banner-anim', () => {
83102
expect(children[0].style.display).to.be('block');
84103
expect(children[1].style.display).to.be('block');
85104
done();
86-
}, 1030);
105+
}, 1300);
87106
});
88107
});

0 commit comments

Comments
 (0)