@@ -3,10 +3,11 @@ import ReactDom from 'react-dom';
33import expect from 'expect.js' ;
44import BannerAnim from '../index' ;
55import '../assets/index.less' ;
6+ import '../examples/assets/index.less' ;
67import TestUtils from 'react-addons-test-utils' ;
78
89const { Element } = BannerAnim ;
9-
10+ const BgElement = Element . BgElement ;
1011describe ( '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