{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/comments/93800835","pull_request_review_id":14335855,"id":93800835,"diff_hunk":"@@ -0,0 +1,117 @@\n+import React from 'react';\n+import {\n+  renderIntoDocument,\n+  findRenderedComponentWithType,\n+} from 'react-addons-test-utils';\n+import { findDOMNode } from 'react-dom';\n+import { Provider } from 'react-redux';\n+\n+import * as landingActions from 'amo/actions/landing';\n+import {\n+  LandingPageBase,\n+  mapStateToProps,\n+  singularizeAddonType,\n+} from 'amo/components/LandingPage';\n+import createStore from 'amo/store';\n+import I18nProvider from 'core/i18n/Provider';\n+import { fakeAddon } from 'tests/client/amo/helpers';\n+import { getFakeI18nInst } from 'tests/client/helpers';\n+\n+\n+describe('<LandingPage />', () => {\n+  function render({ ...props }) {\n+    const initialState = { api: { clientApp: 'android', lang: 'en-GB' } };\n+\n+    return findDOMNode(findRenderedComponentWithType(renderIntoDocument(\n+      <Provider store={createStore(initialState)}>\n+        <I18nProvider i18n={getFakeI18nInst()}>\n+          <LandingPageBase i18n={getFakeI18nInst()} {...props} />\n+        </I18nProvider>\n+      </Provider>\n+    ), LandingPageBase));\n+  }\n+\n+  it('renders a LandingPage with no addons set', () => {\n+    const root = render({\n+      addonType: 'extension',\n+    });\n+\n+    assert.include(root.textContent, 'Featured extensions');\n+    assert.include(root.textContent, 'More featured extensions');\n+  });\n+\n+  it('renders a LandingPage with themes HTML', () => {\n+    const root = render({\n+      addonType: 'theme',\n+    });\n+\n+    assert.include(root.textContent, 'Featured themes');\n+    assert.include(root.textContent, 'More featured themes');\n+  });\n+\n+  it('renders each add-on when set', () => {\n+    const props = {\n+      addonType: 'theme',\n+      featuredAddons: [\n+        { ...fakeAddon, name: 'Howdy', slug: 'howdy' },\n+        { ...fakeAddon, name: 'Howdy again', slug: 'howdy-again' },\n+      ],\n+      highlyRatedAddons: [\n+        { ...fakeAddon, name: 'High', slug: 'high' },\n+        { ...fakeAddon, name: 'High again', slug: 'high-again' },\n+      ],\n+      popularAddons: [\n+        { ...fakeAddon, name: 'Pop', slug: 'pop' },\n+        { ...fakeAddon, name: 'Pop again', slug: 'pop-again' },\n+      ],\n+    };\n+    const root = render(props);\n+\n+    assert.deepEqual(\n+      Object.values(root.querySelectorAll('.SearchResult-heading'))\n+        .map((heading) => heading.textContent),\n+      ['Howdy', 'Howdy again', 'High', 'High again', 'Pop', 'Pop again']\n+    );\n+  });\n+\n+  it('throws if add-on type is not supported', () => {\n+    assert.throws(() => {\n+      render({ addonType: 'XUL' });\n+    }, 'No LandingPage content for addonType: XUL');\n+  });\n+\n+  describe('mapStateToProps()', () => {","path":"tests/client/amo/components/TestLandingPage.js","position":83,"original_position":83,"commit_id":"1a2873c34e4e3eb8a5c050963d1a1b1a89c72a8d","original_commit_id":"1a2873c34e4e3eb8a5c050963d1a1b1a89c72a8d","user":{"login":"kumar303","id":55398,"avatar_url":"https://avatars.githubusercontent.com/u/55398?v=3","gravatar_id":"","url":"https://api.github.com/users/kumar303","html_url":"https://github.com/kumar303","followers_url":"https://api.github.com/users/kumar303/followers","following_url":"https://api.github.com/users/kumar303/following{/other_user}","gists_url":"https://api.github.com/users/kumar303/gists{/gist_id}","starred_url":"https://api.github.com/users/kumar303/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kumar303/subscriptions","organizations_url":"https://api.github.com/users/kumar303/orgs","repos_url":"https://api.github.com/users/kumar303/repos","events_url":"https://api.github.com/users/kumar303/events{/privacy}","received_events_url":"https://api.github.com/users/kumar303/received_events","type":"User","site_admin":false},"body":"Oh, I get your comment about not deleting much code with this new patch. To be honest, I don't think we need this test as long as you use `store.dispatch()` in the rendering test above. \r\n\r\nWe typically isolate state mapper tests from component tests but only for when a real `store` object would make testing the component too difficult. In this case, it doesn't.\r\n\r\nTo put it another way: if you remove this test you'll still get 100% code coverage because the other rendering test will have to rely on mapStateToProps() to pass.","created_at":"2016-12-23T20:44:31Z","updated_at":"2016-12-23T20:48:51Z","html_url":"https://github.com/mozilla/addons-frontend/pull/1493#discussion_r93800835","pull_request_url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/1493","_links":{"self":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/comments/93800835"},"html":{"href":"https://github.com/mozilla/addons-frontend/pull/1493#discussion_r93800835"},"pull_request":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/1493"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/1493","id":98358885,"html_url":"https://github.com/mozilla/addons-frontend/pull/1493","diff_url":"https://github.com/mozilla/addons-frontend/pull/1493.diff","patch_url":"https://github.com/mozilla/addons-frontend/pull/1493.patch","issue_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/1493","number":1493,"state":"open","locked":false,"title":"Add extension/theme landing pages","user":{"login":"tofumatt","id":90871,"avatar_url":"https://avatars.githubusercontent.com/u/90871?v=3","gravatar_id":"","url":"https://api.github.com/users/tofumatt","html_url":"https://github.com/tofumatt","followers_url":"https://api.github.com/users/tofumatt/followers","following_url":"https://api.github.com/users/tofumatt/following{/other_user}","gists_url":"https://api.github.com/users/tofumatt/gists{/gist_id}","starred_url":"https://api.github.com/users/tofumatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tofumatt/subscriptions","organizations_url":"https://api.github.com/users/tofumatt/orgs","repos_url":"https://api.github.com/users/tofumatt/repos","events_url":"https://api.github.com/users/tofumatt/events{/privacy}","received_events_url":"https://api.github.com/users/tofumatt/received_events","type":"User","site_admin":false},"body":"Fixes #1285\r\nFixes #1286 \r\n\r\n### Screenshots\r\n\r\n![screen shot 2016-12-16 at 15 57 55](https://cloud.githubusercontent.com/assets/90871/21269038/045e86c6-c3a9-11e6-9d8f-1d8bbbada7cd.png)\r\n\r\n\r\n![screen shot 2016-12-16 at 15 58 03](https://cloud.githubusercontent.com/assets/90871/21269043/08a69d54-c3a9-11e6-9465-5fbb97d54ad7.png)\r\n\r\n![screen shot 2016-12-16 at 15 58 05](https://cloud.githubusercontent.com/assets/90871/21269052/0ca557e2-c3a9-11e6-96db-e5f2a4833c9d.png)\r\n\r\n### Video\r\n\r\n![dec-16-2016 16-03-42](https://cloud.githubusercontent.com/assets/90871/21269097/44fc71ca-c3a9-11e6-9827-282ba7d123c1.gif)\r\n","created_at":"2016-12-16T16:02:33Z","updated_at":"2016-12-23T20:48:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2837a5d6d97d84b39641005a4bd31f2867999157","assignee":{"login":"kumar303","id":55398,"avatar_url":"https://avatars.githubusercontent.com/u/55398?v=3","gravatar_id":"","url":"https://api.github.com/users/kumar303","html_url":"https://github.com/kumar303","followers_url":"https://api.github.com/users/kumar303/followers","following_url":"https://api.github.com/users/kumar303/following{/other_user}","gists_url":"https://api.github.com/users/kumar303/gists{/gist_id}","starred_url":"https://api.github.com/users/kumar303/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kumar303/subscriptions","organizations_url":"https://api.github.com/users/kumar303/orgs","repos_url":"https://api.github.com/users/kumar303/repos","events_url":"https://api.github.com/users/kumar303/events{/privacy}","received_events_url":"https://api.github.com/users/kumar303/received_events","type":"User","site_admin":false},"assignees":[{"login":"kumar303","id":55398,"avatar_url":"https://avatars.githubusercontent.com/u/55398?v=3","gravatar_id":"","url":"https://api.github.com/users/kumar303","html_url":"https://github.com/kumar303","followers_url":"https://api.github.com/users/kumar303/followers","following_url":"https://api.github.com/users/kumar303/following{/other_user}","gists_url":"https://api.github.com/users/kumar303/gists{/gist_id}","starred_url":"https://api.github.com/users/kumar303/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kumar303/subscriptions","organizations_url":"https://api.github.com/users/kumar303/orgs","repos_url":"https://api.github.com/users/kumar303/repos","events_url":"https://api.github.com/users/kumar303/events{/privacy}","received_events_url":"https://api.github.com/users/kumar303/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/1493/commits","review_comments_url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/1493/comments","review_comment_url":"https://api.github.com/repos/mozilla/addons-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/1493/comments","statuses_url":"https://api.github.com/repos/mozilla/addons-frontend/statuses/1a2873c34e4e3eb8a5c050963d1a1b1a89c72a8d","head":{"label":"mozilla:extension-page-1285-1286-redux","ref":"extension-page-1285-1286-redux","sha":"1a2873c34e4e3eb8a5c050963d1a1b1a89c72a8d","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":52104368,"name":"addons-frontend","full_name":"mozilla/addons-frontend","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/addons-frontend","description":"Front-end infrastructure and code to complement mozilla/addons-server","fork":false,"url":"https://api.github.com/repos/mozilla/addons-frontend","forks_url":"https://api.github.com/repos/mozilla/addons-frontend/forks","keys_url":"https://api.github.com/repos/mozilla/addons-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/addons-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/addons-frontend/teams","hooks_url":"https://api.github.com/repos/mozilla/addons-frontend/hooks","issue_events_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/addons-frontend/events","assignees_url":"https://api.github.com/repos/mozilla/addons-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/addons-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/addons-frontend/tags","blobs_url":"https://api.github.com/repos/mozilla/addons-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/addons-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/addons-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/addons-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/addons-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/addons-frontend/languages","stargazers_url":"https://api.github.com/repos/mozilla/addons-frontend/stargazers","contributors_url":"https://api.github.com/repos/mozilla/addons-frontend/contributors","subscribers_url":"https://api.github.com/repos/mozilla/addons-frontend/subscribers","subscription_url":"https://api.github.com/repos/mozilla/addons-frontend/subscription","commits_url":"https://api.github.com/repos/mozilla/addons-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/addons-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/addons-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/addons-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/addons-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/addons-frontend/merges","archive_url":"https://api.github.com/repos/mozilla/addons-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/addons-frontend/downloads","issues_url":"https://api.github.com/repos/mozilla/addons-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/addons-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/addons-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/addons-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/addons-frontend/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/addons-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/addons-frontend/deployments","created_at":"2016-02-19T17:25:57Z","updated_at":"2016-12-10T17:31:12Z","pushed_at":"2016-12-23T20:07:50Z","git_url":"git://github.com/mozilla/addons-frontend.git","ssh_url":"git@github.com:mozilla/addons-frontend.git","clone_url":"https://github.com/mozilla/addons-frontend.git","svn_url":"https://github.com/mozilla/addons-frontend","homepage":null,"size":182925,"stargazers_count":16,"watchers_count":16,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":168,"forks":19,"open_issues":168,"watchers":16,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"e81ece3bf2e7353130873b00adce55b24c3714ae","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":52104368,"name":"addons-frontend","full_name":"mozilla/addons-frontend","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/addons-frontend","description":"Front-end infrastructure and code to complement mozilla/addons-server","fork":false,"url":"https://api.github.com/repos/mozilla/addons-frontend","forks_url":"https://api.github.com/repos/mozilla/addons-frontend/forks","keys_url":"https://api.github.com/repos/mozilla/addons-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/addons-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/addons-frontend/teams","hooks_url":"https://api.github.com/repos/mozilla/addons-frontend/hooks","issue_events_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/addons-frontend/events","assignees_url":"https://api.github.com/repos/mozilla/addons-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/addons-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/addons-frontend/tags","blobs_url":"https://api.github.com/repos/mozilla/addons-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/addons-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/addons-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/addons-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/addons-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/addons-frontend/languages","stargazers_url":"https://api.github.com/repos/mozilla/addons-frontend/stargazers","contributors_url":"https://api.github.com/repos/mozilla/addons-frontend/contributors","subscribers_url":"https://api.github.com/repos/mozilla/addons-frontend/subscribers","subscription_url":"https://api.github.com/repos/mozilla/addons-frontend/subscription","commits_url":"https://api.github.com/repos/mozilla/addons-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/addons-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/addons-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/addons-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/addons-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/addons-frontend/merges","archive_url":"https://api.github.com/repos/mozilla/addons-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/addons-frontend/downloads","issues_url":"https://api.github.com/repos/mozilla/addons-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/addons-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/addons-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/addons-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/addons-frontend/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/addons-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/addons-frontend/deployments","created_at":"2016-02-19T17:25:57Z","updated_at":"2016-12-10T17:31:12Z","pushed_at":"2016-12-23T20:07:50Z","git_url":"git://github.com/mozilla/addons-frontend.git","ssh_url":"git@github.com:mozilla/addons-frontend.git","clone_url":"https://github.com/mozilla/addons-frontend.git","svn_url":"https://github.com/mozilla/addons-frontend","homepage":null,"size":182925,"stargazers_count":16,"watchers_count":16,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":168,"forks":19,"open_issues":168,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/1493"},"html":{"href":"https://github.com/mozilla/addons-frontend/pull/1493"},"issue":{"href":"https://api.github.com/repos/mozilla/addons-frontend/issues/1493"},"comments":{"href":"https://api.github.com/repos/mozilla/addons-frontend/issues/1493/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/1493/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/addons-frontend/pulls/1493/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/addons-frontend/statuses/1a2873c34e4e3eb8a5c050963d1a1b1a89c72a8d"}}}}
{"actor":{"display_login":"kumar303"}}