Skip to content

Commit

Permalink
fix spec
Browse files Browse the repository at this point in the history
  • Loading branch information
jljsj33 committed May 23, 2016
1 parent f08a521 commit 239c2cd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/BannerAnim.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class BannerAnim extends Component {
} else {
window.detachEvent('onresize', this.getDomDataSetToState);
}
this.cancelRequestAnimationFrame();
}

onMouseEnter() {
Expand Down
2 changes: 1 addition & 1 deletion src/Element.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ Element.propTypes = {
callBack: PropTypes.func,
bgParallax: PropTypes.object,
followParallax: PropTypes.object,
show: PropTypes.string,
show: PropTypes.bool,
};
Element.defaultProps = {
component: 'div',
Expand Down
14 changes: 9 additions & 5 deletions tests/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ describe('rc-banner-anim', function() {
type: 'across',
});
const children = TestUtils.scryRenderedDOMComponentsWithClass(instance, 'banner-anim-elem');
expect(children[0].style.display).to.be('none');
expect(children[1].style.display).to.not.be.ok();
setTimeout(()=> {
expect(children[0].style.display).to.be('none');
expect(children[1].style.display).to.be('block');
});
});

it('banner animation autoplay', function(done) {
Expand All @@ -82,10 +84,12 @@ describe('rc-banner-anim', function() {
type: 'across',
});
const children = TestUtils.scryRenderedDOMComponentsWithClass(instance, 'banner-anim-elem');
expect(children[0].style.display).to.not.be.ok();
expect(children[0].style.display).to.be('block');
expect(children[1].style.display).to.be('none');
setTimeout(()=> {
expect(children[1].style.display).to.not.be.ok();
expect(children[0].style.display).to.be('block');
expect(children[1].style.display).to.be('block');
done();
}, 1650);
}, 1030);
});
});

0 comments on commit 239c2cd

Please sign in to comment.