{"action":"created","issue":{"url":"https://api.github.com/repos/chenglou/react-motion/issues/454","repository_url":"https://api.github.com/repos/chenglou/react-motion","labels_url":"https://api.github.com/repos/chenglou/react-motion/issues/454/labels{/name}","comments_url":"https://api.github.com/repos/chenglou/react-motion/issues/454/comments","events_url":"https://api.github.com/repos/chenglou/react-motion/issues/454/events","html_url":"https://github.com/chenglou/react-motion/issues/454","id":222419769,"number":454,"title":"After update to 0.4.8 shapshot testing fails","user":{"login":"AntonovAv","id":11208532,"avatar_url":"https://avatars1.githubusercontent.com/u/11208532?v=3","gravatar_id":"","url":"https://api.github.com/users/AntonovAv","html_url":"https://github.com/AntonovAv","followers_url":"https://api.github.com/users/AntonovAv/followers","following_url":"https://api.github.com/users/AntonovAv/following{/other_user}","gists_url":"https://api.github.com/users/AntonovAv/gists{/gist_id}","starred_url":"https://api.github.com/users/AntonovAv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AntonovAv/subscriptions","organizations_url":"https://api.github.com/users/AntonovAv/orgs","repos_url":"https://api.github.com/users/AntonovAv/repos","events_url":"https://api.github.com/users/AntonovAv/events{/privacy}","received_events_url":"https://api.github.com/users/AntonovAv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-04-18T13:38:04Z","updated_at":"2017-04-25T02:02:25Z","closed_at":null,"body":"after update to new version `0.4.8` test fails\r\n![image](https://cloud.githubusercontent.com/assets/11208532/25133210/adc1ba24-2454-11e7-9636-ea557cfda7bf.png)\r\n\r\ncomponent code\r\n```\r\nimport React, { PureComponent } from 'react'\r\nimport PropTypes from 'prop-types'\r\nimport messages from '../messages'\r\nimport { FormattedMessage } from 'react-intl'\r\nimport styles from './AddCompany.css'\r\nimport plusCompany from 'images/switcher/plus-company.svg'\r\nimport { Motion, spring } from 'react-motion'\r\nimport cx from 'classnames'\r\n\r\nexport class AddCompany extends PureComponent {\r\n\r\n  constructor(props) {\r\n    super(props)\r\n\r\n    this.state = {\r\n      isExpanded: false,\r\n      expandInProgress: false,\r\n      maxHeight: 20\r\n    }\r\n  }\r\n\r\n  onPlusClickHandler = () => {\r\n    this.setState({\r\n      isExpanded: true,\r\n      expandInProgress: true,\r\n      maxHeight: 50\r\n    })\r\n  }\r\n\r\n  onTransitionEnd = () => {\r\n    this.setState({\r\n      expandInProgress: false\r\n    })\r\n  }\r\n\r\n  handleOnAddCompanyClick = () => {\r\n    if (!this.props.disabled) {\r\n      this.props.onAddCompanyAction()\r\n    }\r\n  }\r\n\r\n  render() {\r\n    const containerClass = cx(\r\n      styles.container,\r\n      {[styles.expanded]: this.state.isExpanded}\r\n    )\r\n    const linkClass = cx(\r\n      styles.link,\r\n      {[styles.disabled]: this.props.disabled}\r\n    )\r\n    return (\r\n      <Motion\r\n        defaultStyle={{\r\n          h: 20\r\n        }}\r\n        style={{\r\n          h: spring(this.state.maxHeight, {\r\n            stiffness: 800,\r\n            damping: 40,\r\n            precision: 0.5\r\n          })\r\n        }}\r\n        onRest={this.onTransitionEnd}\r\n      >\r\n        {({h}) =>\r\n          <div className={containerClass} style={{maxHeight: h + 'px'}}>\r\n            {\r\n              this.state.isExpanded ? (\r\n                <div className={linkClass} onClick={this.handleOnAddCompanyClick}>\r\n                  <FormattedMessage {...messages.connectToAnotherQb}/>\r\n                </div>\r\n              ) : (\r\n                <div className={styles.plus} onClick={this.onPlusClickHandler}>\r\n                  <img src={plusCompany}/>\r\n                </div>\r\n              )}\r\n          </div>\r\n        }\r\n      </Motion>\r\n    )\r\n  }\r\n}\r\n\r\nAddCompany.propTypes = {\r\n  onAddCompanyAction: PropTypes.func.isRequired,\r\n  disabled: PropTypes.bool\r\n}\r\n\r\nexport default AddCompany\r\n```\r\ntest code \r\n```\r\nimport { mount } from 'enzyme'\r\nimport toJson from 'enzyme-to-json'\r\n...\r\nit('component rendering', () => {\r\n    const component = mount(<AddCompany onAddCompanyAction={jest.fn()}/>)\r\n    expect(toJson(component)).toMatchSnapshot()\r\n  })\r\n```\r\npackage.json\r\n```\r\n \"react\": \"15.4.1\",\r\n\"react-motion\": \"^0.4.7\",\r\n\"jest\": \"^19.0.2\",\r\n\"enzyme\": \"^2.7.1\",\r\n\"enzyme-to-json\": \"^1.1.3\",\r\n```"},"comment":{"url":"https://api.github.com/repos/chenglou/react-motion/issues/comments/296870389","html_url":"https://github.com/chenglou/react-motion/issues/454#issuecomment-296870389","issue_url":"https://api.github.com/repos/chenglou/react-motion/issues/454","id":296870389,"user":{"login":"nkbt","id":175264,"avatar_url":"https://avatars3.githubusercontent.com/u/175264?v=3","gravatar_id":"","url":"https://api.github.com/users/nkbt","html_url":"https://github.com/nkbt","followers_url":"https://api.github.com/users/nkbt/followers","following_url":"https://api.github.com/users/nkbt/following{/other_user}","gists_url":"https://api.github.com/users/nkbt/gists{/gist_id}","starred_url":"https://api.github.com/users/nkbt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkbt/subscriptions","organizations_url":"https://api.github.com/users/nkbt/orgs","repos_url":"https://api.github.com/users/nkbt/repos","events_url":"https://api.github.com/users/nkbt/events{/privacy}","received_events_url":"https://api.github.com/users/nkbt/received_events","type":"User","site_admin":false},"created_at":"2017-04-25T02:02:25Z","updated_at":"2017-04-25T02:02:25Z","body":"Should be fixed by https://github.com/chenglou/react-motion/pull/455 (just merged)\r\n\r\nNeed to publish new version but if anyone can try master meanwhile - that would be very helpful"}}
{"actor":{"display_login":"nkbt"}}