{"action":"created","issue":{"url":"https://api.github.com/repos/emotion-js/emotion/issues/733","repository_url":"https://api.github.com/repos/emotion-js/emotion","labels_url":"https://api.github.com/repos/emotion-js/emotion/issues/733/labels{/name}","comments_url":"https://api.github.com/repos/emotion-js/emotion/issues/733/comments","events_url":"https://api.github.com/repos/emotion-js/emotion/issues/733/events","html_url":"https://github.com/emotion-js/emotion/issues/733","id":333450302,"node_id":"MDU6SXNzdWUzMzM0NTAzMDI=","number":733,"title":"Enzyme .text() selector fails on emotion styled components","user":{"login":"tennisgent","id":1782077,"node_id":"MDQ6VXNlcjE3ODIwNzc=","avatar_url":"https://avatars3.githubusercontent.com/u/1782077?v=4","gravatar_id":"","url":"https://api.github.com/users/tennisgent","html_url":"https://github.com/tennisgent","followers_url":"https://api.github.com/users/tennisgent/followers","following_url":"https://api.github.com/users/tennisgent/following{/other_user}","gists_url":"https://api.github.com/users/tennisgent/gists{/gist_id}","starred_url":"https://api.github.com/users/tennisgent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tennisgent/subscriptions","organizations_url":"https://api.github.com/users/tennisgent/orgs","repos_url":"https://api.github.com/users/tennisgent/repos","events_url":"https://api.github.com/users/tennisgent/events{/privacy}","received_events_url":"https://api.github.com/users/tennisgent/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-18T22:00:17Z","updated_at":"2018-06-18T22:07:36Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nThanks for your interest in the project. I appreciate bugs filed and PRs submitted!\r\nPlease make sure that you are familiar with and follow the Code of Conduct for\r\nthis project (found in the CODE_OF_CONDUCT.md file).\r\n\r\nPlease fill out this template with all the relevant information so we can\r\nunderstand what's going on and fix the issue.\r\n\r\nI'll probably ask you to submit the fix (after giving some direction). If you've\r\nnever done that before, that's great! Check this free short video tutorial to\r\nlearn how: http://kcd.im/pull-request\r\n-->\r\n\r\n- `emotion` version: 9.2.3\r\n- `react` version: 16.3.2\r\n\r\nRelevant code.\r\n\r\n```javascript\r\nconst AppContainer = styled('div')`\r\n  font-family: sans-serif;\r\n  text-align: center;\r\n`;\r\n\r\nfunction App() {\r\n  return <AppContainer>Hello CodeSandbox</AppContainer>;\r\n}\r\n\r\ntest(\"should contain proper text\", () => {\r\n  const wrapper = shallow(<App />);\r\n  expect(wrapper.text()).toEqual(\"Hello CodeSandbox\");\r\n});\r\n```\r\n\r\n\r\nWhat you did:\r\n\r\nI am trying to test that a given emotion styled-component has the proper text as children using Enzyme. I have written the above test and it fails with the error message below:\r\n\r\n\r\nWhat happened:\r\n```\r\nExpected value to equal:\r\n  \"Hello CodeSandbox\"\r\nReceived:\r\n  \"<Styled(div) />\"\r\n```\r\n<!-- \r\nPlease provide the full error message/screenshots/anything\r\n \r\n\r\nIf possible, create a CodeSandbox (https://codesandbox.io/s/new) or fork this CodeSandbox (https://codesandbox.io/s/pk1qjqpw67) and add a repoduction of your issue.\r\n\r\nYour bug will get fixed much faster if we can easily run your code. Please paste the link to your CodeSandbox below.\r\n-->\r\n\r\nReproduction:\r\nHere is the error in CodeSandbox: https://codesandbox.io/s/5zkq790j74\r\n\r\nInterestingly, if I call `wrapper.debug()`, it seems to output the proper markup:\r\n\r\n```javascript\r\ntest(\"should contain proper text\", () => {\r\n  const wrapper = shallow(<App />);\r\n  console.log(wrapper.debug());\r\n  expect(wrapper.text()).toEqual(\"Hello CodeSandbox\");\r\n});\r\n\r\n// Outputs:\r\n// <Styled(div)>\r\n//   Hello CodeSandbox\r\n// </Styled(div)> \r\n```"},"comment":{"url":"https://api.github.com/repos/emotion-js/emotion/issues/comments/398210984","html_url":"https://github.com/emotion-js/emotion/issues/733#issuecomment-398210984","issue_url":"https://api.github.com/repos/emotion-js/emotion/issues/733","id":398210984,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODIxMDk4NA==","user":{"login":"Ailrun","id":12473268,"node_id":"MDQ6VXNlcjEyNDczMjY4","avatar_url":"https://avatars3.githubusercontent.com/u/12473268?v=4","gravatar_id":"","url":"https://api.github.com/users/Ailrun","html_url":"https://github.com/Ailrun","followers_url":"https://api.github.com/users/Ailrun/followers","following_url":"https://api.github.com/users/Ailrun/following{/other_user}","gists_url":"https://api.github.com/users/Ailrun/gists{/gist_id}","starred_url":"https://api.github.com/users/Ailrun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ailrun/subscriptions","organizations_url":"https://api.github.com/users/Ailrun/orgs","repos_url":"https://api.github.com/users/Ailrun/repos","events_url":"https://api.github.com/users/Ailrun/events{/privacy}","received_events_url":"https://api.github.com/users/Ailrun/received_events","type":"User","site_admin":false},"created_at":"2018-06-18T22:07:36Z","updated_at":"2018-06-18T22:07:36Z","author_association":"MEMBER","body":"Thank you for your report!\r\nHowever, even without `styled` component, you example doesn't work.\r\nYou can check it via following code.\r\n``` jsx\r\nexport function App() {\r\n  return <div>Hello CodeSandbox</div>;\r\n}\r\n\r\nconst wrapper = shallow(<App />);\r\nconsole.log(wrapper.text());\r\n```"}}
{"actor":{"display_login":"Ailrun"}}