Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
});
afterEach(() => {
try {
ReactDOM.unmountComponentAtNode(container);
} catch (e) {
console.log(e);
container.innerHTML = '';
}
});
it('create works', () => {
expect(TestUtils.scryRenderedDOMComponentsWithClass(list, 'item').length).to.be(4);
});
if (!CssAnimation.isCssAnimationSupported) {
return;
}
it('transitionLeave works', function t2(done) {
this.timeout(5999);
list.handleRemove(0);
setTimeout(() => {
expect(TestUtils.scryRenderedDOMComponentsWithClass(list, 'item').length).to.be(4);
if (!window.callPhantom) {
expect(TestUtils.scryRenderedDOMComponentsWithClass(list, 'item')[0].className)
.to.contain('example-leave');
expect(TestUtils.scryRenderedDOMComponentsWithClass(list, 'item')[0].className)
.to.contain('example-leave-active');
}
}, 100);
setTimeout(() => {
render() {
return (
{options.remove && !this.state.transitionEnter ? null : <div>child element</div>}
);
}
};
}
if (CssAnimation.isCssAnimationSupported) {
single(createClass, 'transition');
}
transition: function transition(animationType, finishCallback) {
var _this = this;
var node = _react2['default'].findDOMNode(this);
var props = this.props;
var transitionName = props.transitionName;
this.stop();
var end = function end() {
_this.stopper = null;
finishCallback();
};
if ((_cssAnimation.isCssAnimationSupported || !props.animation[animationType]) && transitionName && props[transitionMap[animationType]]) {
this.stopper = (0, _cssAnimation2['default'])(node, transitionName + '-' + animationType, end);
} else {
this.stopper = props.animation[animationType](node, end);
}
},