{"action":"created","comment":{"url":"https://api.github.com/repos/u2i/confy/pulls/comments/72815295","id":72815295,"diff_hunk":"@@ -0,0 +1,116 @@\n+import React from 'react';\n+import { shallow } from 'enzyme';\n+import CalendarRow from '../../app/components/calendar/CalendarRow';\n+import EventWrapper from '../../app/components/calendar/event/EventWrapper';\n+import TimeCell from '../../app/components/calendar/TimeCell';\n+import { expect } from 'chai';\n+\n+describe('<CalendarRow />', () => {\n+  const SECONDS_IN_DAY = 24 * 60 * 60;\n+  const start1 = new Date();\n+  const start1TimestampInSeconds = start1.getTime() / 1000;\n+  const start2 = new Date((new Date()).setHours(start1.getHours() + 4));\n+  const start2TimestampInSeconds = start2.getTime() / 1000;\n+  const start3 = new Date();\n+  start3.setDate(start1.getDate() + 1);\n+  const start3TimestampInSeconds = start3.getTime() / 1000;\n+  const start4 = new Date((new Date()).setHours(start3.getHours() + 4));\n+  const start4TimestampInSeconds = start4.getTime() / 1000;\n+  const event1 = {\n+    start:           { date_time: start1 },\n+    start_timestamp: start1TimestampInSeconds\n+  };\n+  const event2 = {\n+    start:           { date_time: start2 },\n+    start_timestamp: start2TimestampInSeconds\n+  };\n+  const event3 = {\n+    start:           { date_time: start3 },\n+    start_timestamp: start3TimestampInSeconds\n+  };\n+  const event4 = {\n+    start:           { date_time: start4 },\n+    start_timestamp: start4TimestampInSeconds\n+  };\n+  const group1 = [event1, event2];\n+  const group2 = [event3, event4];\n+  const events = [group1, group2];\n+  const days = [new Date(), new Date(), new Date()];\n+  const unitEventLengthInSeconds = 1800;\n+  const time = new Date();\n+  const props = { events, days, unitEventLengthInSeconds };\n+  let wrapper = shallow(<CalendarRow time={time} {...props} />);\n+  const wrapperInstance = wrapper.instance();\n+\n+  describe('#render()', () => {\n+    it('renders exactly one <tr />', () => {\n+      expect(wrapper.find('tr')).to.have.length(1);\n+    });\n+\n+    it('renders exactly one <TimeCell /> inside <tr />', () => {\n+      expect(wrapper.find('tr').find(TimeCell)).to.have.length(1);\n+    });\n+\n+    it('renders <EventWrapper /> inside <tr /> for each day in days array', () => {\n+      expect(wrapper.find('tr').find(EventWrapper)).to.have.length(days.length);\n+    });\n+  });\n+\n+  describe('#_groupInDay()', () => {\n+    const beginningOfDay = new Date(start1.getTime());\n+    beginningOfDay.setSeconds(0);\n+    beginningOfDay.setMinutes(0);\n+    beginningOfDay.setHours(0);\n+    const beginningOfDayTimestamp = beginningOfDay.getTime() / 1000;\n+\n+    it('checks if events group belongs to a specific day', () => {\n+      expect(wrapperInstance._groupInDay(events[0], beginningOfDayTimestamp)).to.eq(true);\n+      const timestampDayBefore = beginningOfDayTimestamp - SECONDS_IN_DAY;\n+      expect(wrapperInstance._groupInDay(events[0], timestampDayBefore)).to.eq(false);\n+    });\n+  });\n+\n+  describe('#_eventGroupContaining()', () => {\n+    it('returns events group for specific timestamp', () => {\n+      expect(wrapperInstance._eventGroupContaining(start1TimestampInSeconds)).to.eq(group1);\n+    });\n+  });\n+\n+  describe('#_eventsStartingAt()', () => {\n+    it('returns events from group that starts at the specified timestamp', () => {\n+      expect(wrapperInstance._eventsStartingAt(start1TimestampInSeconds, group1)).to.include(event1);\n+      expect(wrapperInstance._eventsStartingAt(start1TimestampInSeconds, group1)).not.to.include(event2);\n+    });\n+  });\n+\n+  describe('#_displayTime()', () => {\n+    describe('displayMinutes prop is true', () => {\n+      let wrapper = shallow(<CalendarRow displayMinutes time={time} {...props} />);\n+      it('returns true', () => {\n+        expect(wrapper.instance()._displayTime()).to.eq(true);\n+      });\n+    });\n+\n+    describe('displayMinutes prop is false', () => {\n+      describe('minutes of time prop equals 0', () => {\n+        const newTime = new Date(time.getTime());\n+        newTime.setMinutes(0);\n+        const wrapper = shallow(<CalendarRow time={newTime} {...props} />);\n+\n+        it('returns true', () => {\n+          expect(wrapper.instance()._displayTime()).to.eq(true);\n+        });\n+      });\n+\n+      describe('minutes of time prop doest not equal 0', () => {\n+        const newTime = new Date(time.getTime());\n+        newTime.setMinutes(1);\n+        const wrapper = shallow(<CalendarRow time={newTime} {...props} />);","path":"client/test/calendar/CalendarRowComponent.spec.jsx","position":108,"original_position":108,"commit_id":"71bdeb810f53fda0fe31bfc7c3adaead40c5a156","original_commit_id":"71bdeb810f53fda0fe31bfc7c3adaead40c5a156","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"'wrapper' is already declared in the upper scope    no-shadow","created_at":"2016-07-29T15:53:20Z","updated_at":"2016-07-29T15:53:20Z","html_url":"https://github.com/u2i/confy/pull/67#discussion_r72815295","pull_request_url":"https://api.github.com/repos/u2i/confy/pulls/67","_links":{"self":{"href":"https://api.github.com/repos/u2i/confy/pulls/comments/72815295"},"html":{"href":"https://github.com/u2i/confy/pull/67#discussion_r72815295"},"pull_request":{"href":"https://api.github.com/repos/u2i/confy/pulls/67"}}},"pull_request":{"url":"https://api.github.com/repos/u2i/confy/pulls/67","id":79380557,"html_url":"https://github.com/u2i/confy/pull/67","diff_url":"https://github.com/u2i/confy/pull/67.diff","patch_url":"https://github.com/u2i/confy/pull/67.patch","issue_url":"https://api.github.com/repos/u2i/confy/issues/67","number":67,"state":"open","locked":false,"title":"specs for CalendarRow component","user":{"login":"jtkpiotr","id":11637264,"avatar_url":"https://avatars.githubusercontent.com/u/11637264?v=3","gravatar_id":"","url":"https://api.github.com/users/jtkpiotr","html_url":"https://github.com/jtkpiotr","followers_url":"https://api.github.com/users/jtkpiotr/followers","following_url":"https://api.github.com/users/jtkpiotr/following{/other_user}","gists_url":"https://api.github.com/users/jtkpiotr/gists{/gist_id}","starred_url":"https://api.github.com/users/jtkpiotr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtkpiotr/subscriptions","organizations_url":"https://api.github.com/users/jtkpiotr/orgs","repos_url":"https://api.github.com/users/jtkpiotr/repos","events_url":"https://api.github.com/users/jtkpiotr/events{/privacy}","received_events_url":"https://api.github.com/users/jtkpiotr/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-29T15:44:04Z","updated_at":"2016-07-29T15:53:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7b8ad08dd7934b70797a5c3a588328f5bff365fa","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/u2i/confy/pulls/67/commits","review_comments_url":"https://api.github.com/repos/u2i/confy/pulls/67/comments","review_comment_url":"https://api.github.com/repos/u2i/confy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/u2i/confy/issues/67/comments","statuses_url":"https://api.github.com/repos/u2i/confy/statuses/71bdeb810f53fda0fe31bfc7c3adaead40c5a156","head":{"label":"u2i:calendar-row-component-tests","ref":"calendar-row-component-tests","sha":"71bdeb810f53fda0fe31bfc7c3adaead40c5a156","user":{"login":"u2i","id":856377,"avatar_url":"https://avatars.githubusercontent.com/u/856377?v=3","gravatar_id":"","url":"https://api.github.com/users/u2i","html_url":"https://github.com/u2i","followers_url":"https://api.github.com/users/u2i/followers","following_url":"https://api.github.com/users/u2i/following{/other_user}","gists_url":"https://api.github.com/users/u2i/gists{/gist_id}","starred_url":"https://api.github.com/users/u2i/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/u2i/subscriptions","organizations_url":"https://api.github.com/users/u2i/orgs","repos_url":"https://api.github.com/users/u2i/repos","events_url":"https://api.github.com/users/u2i/events{/privacy}","received_events_url":"https://api.github.com/users/u2i/received_events","type":"Organization","site_admin":false},"repo":{"id":62560182,"name":"confy","full_name":"u2i/confy","owner":{"login":"u2i","id":856377,"avatar_url":"https://avatars.githubusercontent.com/u/856377?v=3","gravatar_id":"","url":"https://api.github.com/users/u2i","html_url":"https://github.com/u2i","followers_url":"https://api.github.com/users/u2i/followers","following_url":"https://api.github.com/users/u2i/following{/other_user}","gists_url":"https://api.github.com/users/u2i/gists{/gist_id}","starred_url":"https://api.github.com/users/u2i/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/u2i/subscriptions","organizations_url":"https://api.github.com/users/u2i/orgs","repos_url":"https://api.github.com/users/u2i/repos","events_url":"https://api.github.com/users/u2i/events{/privacy}","received_events_url":"https://api.github.com/users/u2i/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/u2i/confy","description":null,"fork":false,"url":"https://api.github.com/repos/u2i/confy","forks_url":"https://api.github.com/repos/u2i/confy/forks","keys_url":"https://api.github.com/repos/u2i/confy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/u2i/confy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/u2i/confy/teams","hooks_url":"https://api.github.com/repos/u2i/confy/hooks","issue_events_url":"https://api.github.com/repos/u2i/confy/issues/events{/number}","events_url":"https://api.github.com/repos/u2i/confy/events","assignees_url":"https://api.github.com/repos/u2i/confy/assignees{/user}","branches_url":"https://api.github.com/repos/u2i/confy/branches{/branch}","tags_url":"https://api.github.com/repos/u2i/confy/tags","blobs_url":"https://api.github.com/repos/u2i/confy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/u2i/confy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/u2i/confy/git/refs{/sha}","trees_url":"https://api.github.com/repos/u2i/confy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/u2i/confy/statuses/{sha}","languages_url":"https://api.github.com/repos/u2i/confy/languages","stargazers_url":"https://api.github.com/repos/u2i/confy/stargazers","contributors_url":"https://api.github.com/repos/u2i/confy/contributors","subscribers_url":"https://api.github.com/repos/u2i/confy/subscribers","subscription_url":"https://api.github.com/repos/u2i/confy/subscription","commits_url":"https://api.github.com/repos/u2i/confy/commits{/sha}","git_commits_url":"https://api.github.com/repos/u2i/confy/git/commits{/sha}","comments_url":"https://api.github.com/repos/u2i/confy/comments{/number}","issue_comment_url":"https://api.github.com/repos/u2i/confy/issues/comments{/number}","contents_url":"https://api.github.com/repos/u2i/confy/contents/{+path}","compare_url":"https://api.github.com/repos/u2i/confy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/u2i/confy/merges","archive_url":"https://api.github.com/repos/u2i/confy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/u2i/confy/downloads","issues_url":"https://api.github.com/repos/u2i/confy/issues{/number}","pulls_url":"https://api.github.com/repos/u2i/confy/pulls{/number}","milestones_url":"https://api.github.com/repos/u2i/confy/milestones{/number}","notifications_url":"https://api.github.com/repos/u2i/confy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/u2i/confy/labels{/name}","releases_url":"https://api.github.com/repos/u2i/confy/releases{/id}","deployments_url":"https://api.github.com/repos/u2i/confy/deployments","created_at":"2016-07-04T12:23:19Z","updated_at":"2016-07-04T13:24:19Z","pushed_at":"2016-07-29T15:53:11Z","git_url":"git://github.com/u2i/confy.git","ssh_url":"git@github.com:u2i/confy.git","clone_url":"https://github.com/u2i/confy.git","svn_url":"https://github.com/u2i/confy","homepage":null,"size":413,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":9,"forks":0,"open_issues":9,"watchers":0,"default_branch":"develop"}},"base":{"label":"u2i:develop","ref":"develop","sha":"68dc28eb536c70d3d31a3f7680e8340b16544d7e","user":{"login":"u2i","id":856377,"avatar_url":"https://avatars.githubusercontent.com/u/856377?v=3","gravatar_id":"","url":"https://api.github.com/users/u2i","html_url":"https://github.com/u2i","followers_url":"https://api.github.com/users/u2i/followers","following_url":"https://api.github.com/users/u2i/following{/other_user}","gists_url":"https://api.github.com/users/u2i/gists{/gist_id}","starred_url":"https://api.github.com/users/u2i/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/u2i/subscriptions","organizations_url":"https://api.github.com/users/u2i/orgs","repos_url":"https://api.github.com/users/u2i/repos","events_url":"https://api.github.com/users/u2i/events{/privacy}","received_events_url":"https://api.github.com/users/u2i/received_events","type":"Organization","site_admin":false},"repo":{"id":62560182,"name":"confy","full_name":"u2i/confy","owner":{"login":"u2i","id":856377,"avatar_url":"https://avatars.githubusercontent.com/u/856377?v=3","gravatar_id":"","url":"https://api.github.com/users/u2i","html_url":"https://github.com/u2i","followers_url":"https://api.github.com/users/u2i/followers","following_url":"https://api.github.com/users/u2i/following{/other_user}","gists_url":"https://api.github.com/users/u2i/gists{/gist_id}","starred_url":"https://api.github.com/users/u2i/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/u2i/subscriptions","organizations_url":"https://api.github.com/users/u2i/orgs","repos_url":"https://api.github.com/users/u2i/repos","events_url":"https://api.github.com/users/u2i/events{/privacy}","received_events_url":"https://api.github.com/users/u2i/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/u2i/confy","description":null,"fork":false,"url":"https://api.github.com/repos/u2i/confy","forks_url":"https://api.github.com/repos/u2i/confy/forks","keys_url":"https://api.github.com/repos/u2i/confy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/u2i/confy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/u2i/confy/teams","hooks_url":"https://api.github.com/repos/u2i/confy/hooks","issue_events_url":"https://api.github.com/repos/u2i/confy/issues/events{/number}","events_url":"https://api.github.com/repos/u2i/confy/events","assignees_url":"https://api.github.com/repos/u2i/confy/assignees{/user}","branches_url":"https://api.github.com/repos/u2i/confy/branches{/branch}","tags_url":"https://api.github.com/repos/u2i/confy/tags","blobs_url":"https://api.github.com/repos/u2i/confy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/u2i/confy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/u2i/confy/git/refs{/sha}","trees_url":"https://api.github.com/repos/u2i/confy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/u2i/confy/statuses/{sha}","languages_url":"https://api.github.com/repos/u2i/confy/languages","stargazers_url":"https://api.github.com/repos/u2i/confy/stargazers","contributors_url":"https://api.github.com/repos/u2i/confy/contributors","subscribers_url":"https://api.github.com/repos/u2i/confy/subscribers","subscription_url":"https://api.github.com/repos/u2i/confy/subscription","commits_url":"https://api.github.com/repos/u2i/confy/commits{/sha}","git_commits_url":"https://api.github.com/repos/u2i/confy/git/commits{/sha}","comments_url":"https://api.github.com/repos/u2i/confy/comments{/number}","issue_comment_url":"https://api.github.com/repos/u2i/confy/issues/comments{/number}","contents_url":"https://api.github.com/repos/u2i/confy/contents/{+path}","compare_url":"https://api.github.com/repos/u2i/confy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/u2i/confy/merges","archive_url":"https://api.github.com/repos/u2i/confy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/u2i/confy/downloads","issues_url":"https://api.github.com/repos/u2i/confy/issues{/number}","pulls_url":"https://api.github.com/repos/u2i/confy/pulls{/number}","milestones_url":"https://api.github.com/repos/u2i/confy/milestones{/number}","notifications_url":"https://api.github.com/repos/u2i/confy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/u2i/confy/labels{/name}","releases_url":"https://api.github.com/repos/u2i/confy/releases{/id}","deployments_url":"https://api.github.com/repos/u2i/confy/deployments","created_at":"2016-07-04T12:23:19Z","updated_at":"2016-07-04T13:24:19Z","pushed_at":"2016-07-29T15:53:11Z","git_url":"git://github.com/u2i/confy.git","ssh_url":"git@github.com:u2i/confy.git","clone_url":"https://github.com/u2i/confy.git","svn_url":"https://github.com/u2i/confy","homepage":null,"size":413,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":9,"forks":0,"open_issues":9,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/u2i/confy/pulls/67"},"html":{"href":"https://github.com/u2i/confy/pull/67"},"issue":{"href":"https://api.github.com/repos/u2i/confy/issues/67"},"comments":{"href":"https://api.github.com/repos/u2i/confy/issues/67/comments"},"review_comments":{"href":"https://api.github.com/repos/u2i/confy/pulls/67/comments"},"review_comment":{"href":"https://api.github.com/repos/u2i/confy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/u2i/confy/pulls/67/commits"},"statuses":{"href":"https://api.github.com/repos/u2i/confy/statuses/71bdeb810f53fda0fe31bfc7c3adaead40c5a156"}}}}
{"actor":{"display_login":"houndci-bot"}}