{"action":"created","issue":{"url":"https://api.github.com/repos/tylercollier/redux-form-test/issues/11","repository_url":"https://api.github.com/repos/tylercollier/redux-form-test","labels_url":"https://api.github.com/repos/tylercollier/redux-form-test/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/tylercollier/redux-form-test/issues/11/comments","events_url":"https://api.github.com/repos/tylercollier/redux-form-test/issues/11/events","html_url":"https://github.com/tylercollier/redux-form-test/issues/11","id":361762958,"node_id":"MDU6SXNzdWUzNjE3NjI5NTg=","number":11,"title":"Example for integration test- change field value example","user":{"login":"hajdun","id":7523301,"node_id":"MDQ6VXNlcjc1MjMzMDE=","avatar_url":"https://avatars0.githubusercontent.com/u/7523301?v=4","gravatar_id":"","url":"https://api.github.com/users/hajdun","html_url":"https://github.com/hajdun","followers_url":"https://api.github.com/users/hajdun/followers","following_url":"https://api.github.com/users/hajdun/following{/other_user}","gists_url":"https://api.github.com/users/hajdun/gists{/gist_id}","starred_url":"https://api.github.com/users/hajdun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hajdun/subscriptions","organizations_url":"https://api.github.com/users/hajdun/orgs","repos_url":"https://api.github.com/users/hajdun/repos","events_url":"https://api.github.com/users/hajdun/events{/privacy}","received_events_url":"https://api.github.com/users/hajdun/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-19T13:58:44Z","updated_at":"2018-09-27T18:50:14Z","closed_at":"2018-09-27T18:50:14Z","author_association":"NONE","body":"I found it extremely hard to change field value in a jest test. I change the entire form looks based on some values, so I investigated and found this:\r\n\r\nSetup\r\n\r\n \"jest\": \"^23.6.0\",\r\n\"enzyme\": \"^3.6.0\",\r\n\"enzyme-adapter-react-16\": \"^1.5.0\",\r\n\"chai\": \"^4.1.2\",\r\n\"chai-enzyme\": \"^1.0.0-beta.1\",\r\n............\r\nimport chai, { expect } from 'chai'\r\nimport chaiEnzyme from 'chai-enzyme'\r\nimport { Provider } from 'react-redux'\r\nimport { reducer as formReducer } from 'redux-form'\r\nimport { createStore, combineReducers } from 'redux'\r\nimport { configure, mount } from 'enzyme';\r\nimport Adapter from 'enzyme-adapter-react-16';\r\n\r\nconfigure({ adapter: new Adapter() });\r\nchai.use(chaiEnzyme())\r\n\r\nlet store = createStore(combineReducers({ form: formReducer }))\r\n\r\n let wrapper = mount(\r\n    <Provider store={store}>\r\n      <MyComponent   />\r\n    </Provider>\r\n  );\r\n(....)\r\n\r\nTest changing field value\r\n.......\r\n      const fields = wrapper.find('Field')\r\n      let titleInput = fields.findWhere(n => n.prop('name') === 'title')\r\n      const input = titleInput.find('input')\r\n      input.simulate('change', { target: { value: \"sometext\" } })\r\n      wrapper.update()\r\n      expect(store.getState().form.FORMNAME.values.title).to.equal(\"sometext\")\r\n\r\nI hope this example may be useful for someone later :)"},"comment":{"url":"https://api.github.com/repos/tylercollier/redux-form-test/issues/comments/425203097","html_url":"https://github.com/tylercollier/redux-form-test/issues/11#issuecomment-425203097","issue_url":"https://api.github.com/repos/tylercollier/redux-form-test/issues/11","id":425203097,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTIwMzA5Nw==","user":{"login":"tylercollier","id":366538,"node_id":"MDQ6VXNlcjM2NjUzOA==","avatar_url":"https://avatars1.githubusercontent.com/u/366538?v=4","gravatar_id":"","url":"https://api.github.com/users/tylercollier","html_url":"https://github.com/tylercollier","followers_url":"https://api.github.com/users/tylercollier/followers","following_url":"https://api.github.com/users/tylercollier/following{/other_user}","gists_url":"https://api.github.com/users/tylercollier/gists{/gist_id}","starred_url":"https://api.github.com/users/tylercollier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylercollier/subscriptions","organizations_url":"https://api.github.com/users/tylercollier/orgs","repos_url":"https://api.github.com/users/tylercollier/repos","events_url":"https://api.github.com/users/tylercollier/events{/privacy}","received_events_url":"https://api.github.com/users/tylercollier/received_events","type":"User","site_admin":false},"created_at":"2018-09-27T18:50:14Z","updated_at":"2018-09-27T18:50:14Z","author_association":"OWNER","body":"Cool! Thanks! I didn't know about the `findWhere` function."}}
{"actor":{"display_login":"tylercollier"}}