{"action":"created","comment":{"url":"https://api.github.com/repos/civicrm/civihr/pulls/comments/98628821","pull_request_review_id":19273521,"id":98628821,"diff_hunk":"@@ -0,0 +1,75 @@\n+define([\n+  'common/angular',\n+  'common/angularMocks',\n+  'job-contract/app'\n+], function(angular, Mock) {\n+  'use strict';\n+\n+  describe('ContractPayService', function () {\n+    var $httpBackend, responseData, $scope, ContractPayService;\n+\n+    beforeEach(module('hrjc'));\n+    beforeEach(inject(function (_ContractPayService_, _$httpBackend_, _$rootScope_) {\n+      ContractPayService = _ContractPayService_;\n+      $httpBackend = _$httpBackend_;\n+      $scope = _$rootScope_;\n+\n+      responseData = {\n+        \"is_error\": 0,\n+        \"undefined_fields\": [\n+          \"jobcontract_revision_id\"\n+        ],\n+        \"version\": 3,\n+        \"count\": 1,\n+        \"id\": 54,\n+        \"values\": [\n+          {\n+            \"id\": \"54\",\n+            \"pay_scale\": \"4\",\n+            \"is_paid\": \"1\",\n+            \"pay_amount\": \"22000.00\",\n+            \"pay_unit\": \"Year\",\n+            \"pay_currency\": \"GBP\",\n+            \"pay_annualized_est\": \"22000.00\",\n+            \"pay_is_auto_est\": \"0\",\n+            \"annual_benefits\": [\n+\n+            ],\n+            \"annual_deductions\": [\n+\n+            ],\n+            \"pay_cycle\": \"2\",\n+            \"pay_per_cycle_gross\": \"1833.33\",\n+            \"pay_per_cycle_net\": \"1833.33\",\n+            \"jobcontract_revision_id\": \"100\"\n+          }\n+        ],\n+        \"xdebug\": {\n+          \"peakMemory\": 57663456,\n+          \"memory\": 57485784,\n+          \"timeIndex\": 1.65426301956\n+        }\n+      };\n+\n+      $httpBackend.when('GET','/index.php?q=civicrm/ajax/rest&action=get&entity=HRJobContract&json=%7B%22sequential%22:1,%22deleted%22:0%7D').respond(responseData);\n+      $httpBackend.when('GET','/index.php?q=civicrm/ajax/rest&action=get&entity=HRJobPay&json=%7B%22jobcontract_revision_id%22:68,%22sequential%22:1,%22debug%22:null%7D').respond(responseData);\n+      $httpBackend.whenGET(/views.*/).respond(responseData);\n+    }));\n+\n+    describe('when calling getOne()', function () {\n+      it(\"defines getOne() function\", function () {\n+        expect(ContractPayService.getOne).toBeDefined();\n+      });\n+\n+      it('calls getOne functions and returns expected values', function (done) {\n+        $httpBackend.expectGET('/index.php?q=civicrm/ajax/rest&action=get&entity=HRJobContract&json=%7B%22sequential%22:1,%22deleted%22:0%7D');","path":"hrjobcontract/js/test/services/contract-pay_test.js","position":65,"original_position":65,"commit_id":"ee104be070cbb5c43e42a6f015d97c8de5f01d9b","original_commit_id":"ee104be070cbb5c43e42a6f015d97c8de5f01d9b","user":{"login":"dhavalsharma","id":89973,"avatar_url":"https://avatars.githubusercontent.com/u/89973?v=3","gravatar_id":"","url":"https://api.github.com/users/dhavalsharma","html_url":"https://github.com/dhavalsharma","followers_url":"https://api.github.com/users/dhavalsharma/followers","following_url":"https://api.github.com/users/dhavalsharma/following{/other_user}","gists_url":"https://api.github.com/users/dhavalsharma/gists{/gist_id}","starred_url":"https://api.github.com/users/dhavalsharma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhavalsharma/subscriptions","organizations_url":"https://api.github.com/users/dhavalsharma/orgs","repos_url":"https://api.github.com/users/dhavalsharma/repos","events_url":"https://api.github.com/users/dhavalsharma/events{/privacy}","received_events_url":"https://api.github.com/users/dhavalsharma/received_events","type":"User","site_admin":false},"body":"expectGet,flush can be moved into beforeEach","created_at":"2017-01-31T09:43:24Z","updated_at":"2017-01-31T09:46:43Z","html_url":"https://github.com/civicrm/civihr/pull/1369#discussion_r98628821","pull_request_url":"https://api.github.com/repos/civicrm/civihr/pulls/1369","_links":{"self":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/comments/98628821"},"html":{"href":"https://github.com/civicrm/civihr/pull/1369#discussion_r98628821"},"pull_request":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/1369"}}},"pull_request":{"url":"https://api.github.com/repos/civicrm/civihr/pulls/1369","id":102940387,"html_url":"https://github.com/civicrm/civihr/pull/1369","diff_url":"https://github.com/civicrm/civihr/pull/1369.diff","patch_url":"https://github.com/civicrm/civihr/pull/1369.patch","issue_url":"https://api.github.com/repos/civicrm/civihr/issues/1369","number":1369,"state":"open","locked":false,"title":"PCHR-1879: Fix wrong version of contract displayed on clicking view t…","user":{"login":"bmnepali","id":6307362,"avatar_url":"https://avatars.githubusercontent.com/u/6307362?v=3","gravatar_id":"","url":"https://api.github.com/users/bmnepali","html_url":"https://github.com/bmnepali","followers_url":"https://api.github.com/users/bmnepali/followers","following_url":"https://api.github.com/users/bmnepali/following{/other_user}","gists_url":"https://api.github.com/users/bmnepali/gists{/gist_id}","starred_url":"https://api.github.com/users/bmnepali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmnepali/subscriptions","organizations_url":"https://api.github.com/users/bmnepali/orgs","repos_url":"https://api.github.com/users/bmnepali/repos","events_url":"https://api.github.com/users/bmnepali/events{/privacy}","received_events_url":"https://api.github.com/users/bmnepali/received_events","type":"User","site_admin":false},"body":"…his contract revision\r\n\r\n### Issue:\r\nWhen clicking \"View Current Revision\" on contract or clicking \"View Revision\" form Full History tab, it is always displaying the current revision as Data for individual revision were not fetched.\r\n\r\n### Solution:\r\nFetching the following data for the current revision using respective services and sending to the contract modal form to display the info.\r\n1. details\r\n2. hour\r\n3. health\r\n4. pay\r\n5. pension\r\n6. leave\r\n\r\n### Screenshots:\r\n1. When clicking the \"View Current Revision\" button on the contract: Displays the current revision info.\r\n![testing-one](https://cloud.githubusercontent.com/assets/6307362/22289068/d440560c-e321-11e6-9cb7-e975543674b1.gif)\r\n\r\n2. When clicking the \"View Revision\" form the list of revisions in Full History tab: displays the respective revision.\r\n![testing-two](https://cloud.githubusercontent.com/assets/6307362/22289085/e7ef1a62-e321-11e6-9986-5f224923bc64.gif)\r\n\r\n\r\n","created_at":"2017-01-24T15:27:42Z","updated_at":"2017-01-31T09:46:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7fd4c23616debd5ed307f5ffac156e0f7f6814e6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/civicrm/civihr/pulls/1369/commits","review_comments_url":"https://api.github.com/repos/civicrm/civihr/pulls/1369/comments","review_comment_url":"https://api.github.com/repos/civicrm/civihr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/civicrm/civihr/issues/1369/comments","statuses_url":"https://api.github.com/repos/civicrm/civihr/statuses/ee104be070cbb5c43e42a6f015d97c8de5f01d9b","head":{"label":"civicrm:PCHR-1879-wrong-version-of-contract-displayed-on-clicking-view-this-contract-revision","ref":"PCHR-1879-wrong-version-of-contract-displayed-on-clicking-view-this-contract-revision","sha":"ee104be070cbb5c43e42a6f015d97c8de5f01d9b","user":{"login":"civicrm","id":136373,"avatar_url":"https://avatars.githubusercontent.com/u/136373?v=3","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"repo":{"id":10086903,"name":"civihr","full_name":"civicrm/civihr","owner":{"login":"civicrm","id":136373,"avatar_url":"https://avatars.githubusercontent.com/u/136373?v=3","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/civicrm/civihr","description":"CiviHR","fork":false,"url":"https://api.github.com/repos/civicrm/civihr","forks_url":"https://api.github.com/repos/civicrm/civihr/forks","keys_url":"https://api.github.com/repos/civicrm/civihr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/civicrm/civihr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/civicrm/civihr/teams","hooks_url":"https://api.github.com/repos/civicrm/civihr/hooks","issue_events_url":"https://api.github.com/repos/civicrm/civihr/issues/events{/number}","events_url":"https://api.github.com/repos/civicrm/civihr/events","assignees_url":"https://api.github.com/repos/civicrm/civihr/assignees{/user}","branches_url":"https://api.github.com/repos/civicrm/civihr/branches{/branch}","tags_url":"https://api.github.com/repos/civicrm/civihr/tags","blobs_url":"https://api.github.com/repos/civicrm/civihr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/civicrm/civihr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/civicrm/civihr/git/refs{/sha}","trees_url":"https://api.github.com/repos/civicrm/civihr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/civicrm/civihr/statuses/{sha}","languages_url":"https://api.github.com/repos/civicrm/civihr/languages","stargazers_url":"https://api.github.com/repos/civicrm/civihr/stargazers","contributors_url":"https://api.github.com/repos/civicrm/civihr/contributors","subscribers_url":"https://api.github.com/repos/civicrm/civihr/subscribers","subscription_url":"https://api.github.com/repos/civicrm/civihr/subscription","commits_url":"https://api.github.com/repos/civicrm/civihr/commits{/sha}","git_commits_url":"https://api.github.com/repos/civicrm/civihr/git/commits{/sha}","comments_url":"https://api.github.com/repos/civicrm/civihr/comments{/number}","issue_comment_url":"https://api.github.com/repos/civicrm/civihr/issues/comments{/number}","contents_url":"https://api.github.com/repos/civicrm/civihr/contents/{+path}","compare_url":"https://api.github.com/repos/civicrm/civihr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/civicrm/civihr/merges","archive_url":"https://api.github.com/repos/civicrm/civihr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/civicrm/civihr/downloads","issues_url":"https://api.github.com/repos/civicrm/civihr/issues{/number}","pulls_url":"https://api.github.com/repos/civicrm/civihr/pulls{/number}","milestones_url":"https://api.github.com/repos/civicrm/civihr/milestones{/number}","notifications_url":"https://api.github.com/repos/civicrm/civihr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/civicrm/civihr/labels{/name}","releases_url":"https://api.github.com/repos/civicrm/civihr/releases{/id}","deployments_url":"https://api.github.com/repos/civicrm/civihr/deployments","created_at":"2013-05-15T20:06:06Z","updated_at":"2017-01-22T10:49:09Z","pushed_at":"2017-01-31T08:16:12Z","git_url":"git://github.com/civicrm/civihr.git","ssh_url":"git@github.com:civicrm/civihr.git","clone_url":"https://github.com/civicrm/civihr.git","svn_url":"https://github.com/civicrm/civihr","homepage":null,"size":39470,"stargazers_count":7,"watchers_count":7,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"open_issues_count":25,"forks":30,"open_issues":25,"watchers":7,"default_branch":"staging"}},"base":{"label":"civicrm:staging","ref":"staging","sha":"2c931120096fa53539a8d9f78eb6dd72d0887860","user":{"login":"civicrm","id":136373,"avatar_url":"https://avatars.githubusercontent.com/u/136373?v=3","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"repo":{"id":10086903,"name":"civihr","full_name":"civicrm/civihr","owner":{"login":"civicrm","id":136373,"avatar_url":"https://avatars.githubusercontent.com/u/136373?v=3","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/civicrm/civihr","description":"CiviHR","fork":false,"url":"https://api.github.com/repos/civicrm/civihr","forks_url":"https://api.github.com/repos/civicrm/civihr/forks","keys_url":"https://api.github.com/repos/civicrm/civihr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/civicrm/civihr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/civicrm/civihr/teams","hooks_url":"https://api.github.com/repos/civicrm/civihr/hooks","issue_events_url":"https://api.github.com/repos/civicrm/civihr/issues/events{/number}","events_url":"https://api.github.com/repos/civicrm/civihr/events","assignees_url":"https://api.github.com/repos/civicrm/civihr/assignees{/user}","branches_url":"https://api.github.com/repos/civicrm/civihr/branches{/branch}","tags_url":"https://api.github.com/repos/civicrm/civihr/tags","blobs_url":"https://api.github.com/repos/civicrm/civihr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/civicrm/civihr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/civicrm/civihr/git/refs{/sha}","trees_url":"https://api.github.com/repos/civicrm/civihr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/civicrm/civihr/statuses/{sha}","languages_url":"https://api.github.com/repos/civicrm/civihr/languages","stargazers_url":"https://api.github.com/repos/civicrm/civihr/stargazers","contributors_url":"https://api.github.com/repos/civicrm/civihr/contributors","subscribers_url":"https://api.github.com/repos/civicrm/civihr/subscribers","subscription_url":"https://api.github.com/repos/civicrm/civihr/subscription","commits_url":"https://api.github.com/repos/civicrm/civihr/commits{/sha}","git_commits_url":"https://api.github.com/repos/civicrm/civihr/git/commits{/sha}","comments_url":"https://api.github.com/repos/civicrm/civihr/comments{/number}","issue_comment_url":"https://api.github.com/repos/civicrm/civihr/issues/comments{/number}","contents_url":"https://api.github.com/repos/civicrm/civihr/contents/{+path}","compare_url":"https://api.github.com/repos/civicrm/civihr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/civicrm/civihr/merges","archive_url":"https://api.github.com/repos/civicrm/civihr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/civicrm/civihr/downloads","issues_url":"https://api.github.com/repos/civicrm/civihr/issues{/number}","pulls_url":"https://api.github.com/repos/civicrm/civihr/pulls{/number}","milestones_url":"https://api.github.com/repos/civicrm/civihr/milestones{/number}","notifications_url":"https://api.github.com/repos/civicrm/civihr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/civicrm/civihr/labels{/name}","releases_url":"https://api.github.com/repos/civicrm/civihr/releases{/id}","deployments_url":"https://api.github.com/repos/civicrm/civihr/deployments","created_at":"2013-05-15T20:06:06Z","updated_at":"2017-01-22T10:49:09Z","pushed_at":"2017-01-31T08:16:12Z","git_url":"git://github.com/civicrm/civihr.git","ssh_url":"git@github.com:civicrm/civihr.git","clone_url":"https://github.com/civicrm/civihr.git","svn_url":"https://github.com/civicrm/civihr","homepage":null,"size":39470,"stargazers_count":7,"watchers_count":7,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"open_issues_count":25,"forks":30,"open_issues":25,"watchers":7,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/1369"},"html":{"href":"https://github.com/civicrm/civihr/pull/1369"},"issue":{"href":"https://api.github.com/repos/civicrm/civihr/issues/1369"},"comments":{"href":"https://api.github.com/repos/civicrm/civihr/issues/1369/comments"},"review_comments":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/1369/comments"},"review_comment":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/1369/commits"},"statuses":{"href":"https://api.github.com/repos/civicrm/civihr/statuses/ee104be070cbb5c43e42a6f015d97c8de5f01d9b"}}}}
{"actor":{"display_login":"dhavalsharma"}}