{"action":"created","issue":{"url":"https://api.github.com/repos/airbnb/enzyme/issues/532","repository_url":"https://api.github.com/repos/airbnb/enzyme","labels_url":"https://api.github.com/repos/airbnb/enzyme/issues/532/labels{/name}","comments_url":"https://api.github.com/repos/airbnb/enzyme/issues/532/comments","events_url":"https://api.github.com/repos/airbnb/enzyme/issues/532/events","html_url":"https://github.com/airbnb/enzyme/issues/532","id":169635377,"number":532,"title":"Trouble testing react-redux connected components","user":{"login":"michael-iglesias","id":4275784,"avatar_url":"https://avatars.githubusercontent.com/u/4275784?v=3","gravatar_id":"","url":"https://api.github.com/users/michael-iglesias","html_url":"https://github.com/michael-iglesias","followers_url":"https://api.github.com/users/michael-iglesias/followers","following_url":"https://api.github.com/users/michael-iglesias/following{/other_user}","gists_url":"https://api.github.com/users/michael-iglesias/gists{/gist_id}","starred_url":"https://api.github.com/users/michael-iglesias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael-iglesias/subscriptions","organizations_url":"https://api.github.com/users/michael-iglesias/orgs","repos_url":"https://api.github.com/users/michael-iglesias/repos","events_url":"https://api.github.com/users/michael-iglesias/events{/privacy}","received_events_url":"https://api.github.com/users/michael-iglesias/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/airbnb/enzyme/labels/Environment","name":"Environment","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-05T15:37:46Z","updated_at":"2016-08-14T15:26:56Z","closed_at":null,"body":"Hello,\r\n\r\nI'm trying to test a connected component. For some reason, I'm receiving the following error only when testing connected components which throws me off a little...\r\n\r\n'ReferenceError: navigator is not defined'\r\n\r\n```\r\nimport React from 'react';\r\nimport { Provider } from 'react-redux';\r\nimport { Row } from 'react-bootstrap';\r\nimport chai, { expect } from 'chai';\r\nimport dirtyChai from 'dirty-chai';\r\nimport chaiEnzyme from 'chai-enzyme';\r\nimport { mount } from 'enzyme';\r\nimport sinon from 'sinon';\r\nimport jsdom from 'jsdom';\r\nimport configureMockStore from 'redux-mock-store';\r\nimport thunk from 'redux-thunk';\r\nimport promiseMiddleware from 'redux-promise-middleware';\r\nimport PAGE_INITIAL_STATE from '../../reducers/page_reducer';\r\n\r\nconst middlewares = [thunk, promiseMiddleware()];\r\nconst mockStore = configureMockStore(middlewares);\r\n\r\nchai.use(dirtyChai);\r\nchai.use(chaiEnzyme());\r\n\r\nimport KbbSuperHero from './kbb_super_hero.jsx';\r\n\r\nconst doc = jsdom.jsdom('<!doctype html><html><body></body></html>');\r\nglobal.document = doc;\r\nglobal.window = doc.defaultView;\r\n\r\ndescribe('<KbbSuperHero /> = Displayed on KBB Landing Page', () => {\r\n  const mStore = mockStore({app: {kbbToken: 'xxxxxxxxxxx'}, page: PAGE_INITIAL_STATE});\r\n  const spy = sinon.spy();\r\n  const wrapper = mount(\r\n    <Provider store={mStore}>\r\n      <KbbSuperHero showModal={spy} />\r\n    </Provider>\r\n  );\r\n\r\n  it('should display \"Get Your Instant Cash Offer\"', () => {\r\n    expect(wrapper.find('h1').first().text()).to.equal('Get Your Instant Cash Offer');\r\n  });\r\n\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/airbnb/enzyme/issues/comments/239679548","html_url":"https://github.com/airbnb/enzyme/issues/532#issuecomment-239679548","issue_url":"https://api.github.com/repos/airbnb/enzyme/issues/532","id":239679548,"user":{"login":"michael-iglesias","id":4275784,"avatar_url":"https://avatars.githubusercontent.com/u/4275784?v=3","gravatar_id":"","url":"https://api.github.com/users/michael-iglesias","html_url":"https://github.com/michael-iglesias","followers_url":"https://api.github.com/users/michael-iglesias/followers","following_url":"https://api.github.com/users/michael-iglesias/following{/other_user}","gists_url":"https://api.github.com/users/michael-iglesias/gists{/gist_id}","starred_url":"https://api.github.com/users/michael-iglesias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael-iglesias/subscriptions","organizations_url":"https://api.github.com/users/michael-iglesias/orgs","repos_url":"https://api.github.com/users/michael-iglesias/repos","events_url":"https://api.github.com/users/michael-iglesias/events{/privacy}","received_events_url":"https://api.github.com/users/michael-iglesias/received_events","type":"User","site_admin":false},"created_at":"2016-08-14T15:26:56Z","updated_at":"2016-08-14T15:26:56Z","body":"@blainekasten \r\n\r\nEnded up including the following which seems to have resolved the issue.\r\n```\r\nglobal.navigator = {\r\n  userAgent: 'node.js'\r\n};\r\n```"}}
{"actor":{"display_login":"michael-iglesias"}}