{"action":"created","comment":{"url":"https://api.github.com/repos/graycoreio/daffodil/pulls/comments/243442079","pull_request_review_id":187215860,"id":243442079,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MzQ0MjA3OQ==","diff_hunk":"@@ -1,3 +1,75 @@\n+import { TestBed } from '@angular/core/testing';\n+\n+import { DaffCoreTestingModule, DaffProductImageFactory } from '@daffodil/core/testing';\n+import { DaffTestingProductService } from './product.service';\n+import { ProductImage, Product } from '@daffodil/core';\n+\n describe('Driver | Testing | Product | ProductService', () => {\n-  \n+  let productService;\n+  let productImageFactory: jasmine.SpyObj<DaffProductImageFactory>;\n+  let stubProductImages: ProductImage[];\n+\n+  beforeEach(() => {\n+    stubProductImages = new DaffProductImageFactory().createMany(5);\n+    let productImageFactorySpy = jasmine.createSpyObj('DaffProductImageFactory', ['createMany', 'create']);\n+\n+    TestBed.configureTestingModule({\n+      imports: [\n+        DaffCoreTestingModule\n+      ],\n+      providers: [\n+        { provide: DaffProductImageFactory, useValue: productImageFactorySpy }\n+      ]\n+    });\n+\n+    productService = TestBed.get(DaffTestingProductService);\n+    productImageFactory = TestBed.get(DaffProductImageFactory);\n+\n+    productImageFactory.createMany.and.returnValue(stubProductImages);\n+    productImageFactory.create.and.returnValue(stubProductImages[0]);\n+  });\n+\n+  it('should be created', () => {\n+    expect(productService).toBeTruthy();\n+  });\n+\n+  describe('getAll', () => {\n+\n+    it('should return a list of products with images', () => {\n+      productService.getAll().subscribe(products => {\n+        expect(isProduct(products[0])).toBeTruthy();\n+\n+        expect(products[0].images).toEqual(stubProductImages);\n+      });\n+    });\n+  });\n+\n+  describe('getBestSellers', () => {\n+\n+    it('should return an array of products with images', () => {\n+      productService.getBestSellers().subscribe(products => {\n+        expect(isProduct(products[0])).toBeTruthy();\n+        expect(products[0].images).toEqual(stubProductImages);\n+      });\n+    });\n+  });\n+\n+  describe('get', () => {\n+\n+    it('should return a single product with images', () => {\n+      productService.get('id').subscribe(product => {\n+        expect(isProduct(product)).toBeTruthy();\n+        expect(product.images).toEqual(stubProductImages);\n+      });\n+    });\n+  });\n });\n+\n+function isProduct(product: Product) {","path":"libs/driver/testing/src/product/services/product.service.spec.ts","position":null,"original_position":69,"commit_id":"4c1ab126e6223ab31b7f98cbc325d910b8698d73","original_commit_id":"5724cc99427bb5f582cbf15e6cad26cf050808d2","user":{"login":"lderrickable","id":7902778,"node_id":"MDQ6VXNlcjc5MDI3Nzg=","avatar_url":"https://avatars0.githubusercontent.com/u/7902778?v=4","gravatar_id":"","url":"https://api.github.com/users/lderrickable","html_url":"https://github.com/lderrickable","followers_url":"https://api.github.com/users/lderrickable/followers","following_url":"https://api.github.com/users/lderrickable/following{/other_user}","gists_url":"https://api.github.com/users/lderrickable/gists{/gist_id}","starred_url":"https://api.github.com/users/lderrickable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lderrickable/subscriptions","organizations_url":"https://api.github.com/users/lderrickable/orgs","repos_url":"https://api.github.com/users/lderrickable/repos","events_url":"https://api.github.com/users/lderrickable/events{/privacy}","received_events_url":"https://api.github.com/users/lderrickable/received_events","type":"User","site_admin":false},"body":"extracted into a productHelper file in @daffodil/core","created_at":"2018-12-20T22:48:10Z","updated_at":"2018-12-20T22:48:10Z","html_url":"https://github.com/graycoreio/daffodil/pull/150#discussion_r243442079","pull_request_url":"https://api.github.com/repos/graycoreio/daffodil/pulls/150","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/graycoreio/daffodil/pulls/comments/243442079"},"html":{"href":"https://github.com/graycoreio/daffodil/pull/150#discussion_r243442079"},"pull_request":{"href":"https://api.github.com/repos/graycoreio/daffodil/pulls/150"}},"in_reply_to_id":242956166},"pull_request":{"url":"https://api.github.com/repos/graycoreio/daffodil/pulls/150","id":238073516,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM4MDczNTE2","html_url":"https://github.com/graycoreio/daffodil/pull/150","diff_url":"https://github.com/graycoreio/daffodil/pull/150.diff","patch_url":"https://github.com/graycoreio/daffodil/pull/150.patch","issue_url":"https://api.github.com/repos/graycoreio/daffodil/issues/150","number":150,"state":"open","locked":false,"title":"Add Product Images to the product and cart service payloads","user":{"login":"lderrickable","id":7902778,"node_id":"MDQ6VXNlcjc5MDI3Nzg=","avatar_url":"https://avatars0.githubusercontent.com/u/7902778?v=4","gravatar_id":"","url":"https://api.github.com/users/lderrickable","html_url":"https://github.com/lderrickable","followers_url":"https://api.github.com/users/lderrickable/followers","following_url":"https://api.github.com/users/lderrickable/following{/other_user}","gists_url":"https://api.github.com/users/lderrickable/gists{/gist_id}","starred_url":"https://api.github.com/users/lderrickable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lderrickable/subscriptions","organizations_url":"https://api.github.com/users/lderrickable/orgs","repos_url":"https://api.github.com/users/lderrickable/repos","events_url":"https://api.github.com/users/lderrickable/events{/privacy}","received_events_url":"https://api.github.com/users/lderrickable/received_events","type":"User","site_admin":false},"body":"## PR Checklist\r\nPlease check if your PR fulfills the following requirements:\r\n\r\n- [x] The commit message follows our guidelines: https://github.com/graycoreio/daffodil/blob/master/CONTRIBUTING.md#commit\r\n- [x] Tests for the changes have been added (for bug fixes / features)\r\n- [ ] Docs have been added / updated (for bug fixes / features)\r\n\r\n\r\n## PR Type\r\nWhat kind of change does this PR introduce?\r\n```\r\n[ ] Bugfix\r\n[x] Feature\r\n[ ] Code style update (formatting, local variables)\r\n[ ] Refactoring (no functional changes, no api changes)\r\n[ ] Build related changes\r\n[ ] CI related changes\r\n[ ] Documentation content changes\r\n[ ] Other... Please describe:\r\n```\r\n\r\n## What is the current behavior?\r\nImage urls are currently hard coded in the ProductComponent in Foundation Demo.\r\n\r\nIssue Number: https://github.com/graycoreio/daffodil/issues/140\r\n\r\n\r\n## What is the new behavior?\r\nImages for products should come back with the GetProducts/GetProduct service call, and should be stored on redux state.\r\n\r\n## Does this PR introduce a breaking change?\r\n```\r\n[x] Yes\r\n[ ] No\r\n```\r\n\r\n<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->\r\nThe way foundation-demo and any other consuming applications will load product images will fundamentally change and improve. Since this project is in alpha, all breaks to the application will be resolved in this PR.\r\n\r\n## Other information","created_at":"2018-12-12T15:15:55Z","updated_at":"2018-12-20T22:48:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"77f908e279f359ebffbf68c691c3d0621d58bf22","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/graycoreio/daffodil/pulls/150/commits","review_comments_url":"https://api.github.com/repos/graycoreio/daffodil/pulls/150/comments","review_comment_url":"https://api.github.com/repos/graycoreio/daffodil/pulls/comments{/number}","comments_url":"https://api.github.com/repos/graycoreio/daffodil/issues/150/comments","statuses_url":"https://api.github.com/repos/graycoreio/daffodil/statuses/4c1ab126e6223ab31b7f98cbc325d910b8698d73","head":{"label":"graycoreio:images_service_call","ref":"images_service_call","sha":"4c1ab126e6223ab31b7f98cbc325d910b8698d73","user":{"login":"graycoreio","id":33813698,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzODEzNjk4","avatar_url":"https://avatars2.githubusercontent.com/u/33813698?v=4","gravatar_id":"","url":"https://api.github.com/users/graycoreio","html_url":"https://github.com/graycoreio","followers_url":"https://api.github.com/users/graycoreio/followers","following_url":"https://api.github.com/users/graycoreio/following{/other_user}","gists_url":"https://api.github.com/users/graycoreio/gists{/gist_id}","starred_url":"https://api.github.com/users/graycoreio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graycoreio/subscriptions","organizations_url":"https://api.github.com/users/graycoreio/orgs","repos_url":"https://api.github.com/users/graycoreio/repos","events_url":"https://api.github.com/users/graycoreio/events{/privacy}","received_events_url":"https://api.github.com/users/graycoreio/received_events","type":"Organization","site_admin":false},"repo":{"id":128830675,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg4MzA2NzU=","name":"daffodil","full_name":"graycoreio/daffodil","private":false,"owner":{"login":"graycoreio","id":33813698,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzODEzNjk4","avatar_url":"https://avatars2.githubusercontent.com/u/33813698?v=4","gravatar_id":"","url":"https://api.github.com/users/graycoreio","html_url":"https://github.com/graycoreio","followers_url":"https://api.github.com/users/graycoreio/followers","following_url":"https://api.github.com/users/graycoreio/following{/other_user}","gists_url":"https://api.github.com/users/graycoreio/gists{/gist_id}","starred_url":"https://api.github.com/users/graycoreio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graycoreio/subscriptions","organizations_url":"https://api.github.com/users/graycoreio/orgs","repos_url":"https://api.github.com/users/graycoreio/repos","events_url":"https://api.github.com/users/graycoreio/events{/privacy}","received_events_url":"https://api.github.com/users/graycoreio/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/graycoreio/daffodil","description":"A frontend development toolkit for Progressive Web Applications for Ecommerce - built with Angular","fork":false,"url":"https://api.github.com/repos/graycoreio/daffodil","forks_url":"https://api.github.com/repos/graycoreio/daffodil/forks","keys_url":"https://api.github.com/repos/graycoreio/daffodil/keys{/key_id}","collaborators_url":"https://api.github.com/repos/graycoreio/daffodil/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/graycoreio/daffodil/teams","hooks_url":"https://api.github.com/repos/graycoreio/daffodil/hooks","issue_events_url":"https://api.github.com/repos/graycoreio/daffodil/issues/events{/number}","events_url":"https://api.github.com/repos/graycoreio/daffodil/events","assignees_url":"https://api.github.com/repos/graycoreio/daffodil/assignees{/user}","branches_url":"https://api.github.com/repos/graycoreio/daffodil/branches{/branch}","tags_url":"https://api.github.com/repos/graycoreio/daffodil/tags","blobs_url":"https://api.github.com/repos/graycoreio/daffodil/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/graycoreio/daffodil/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/graycoreio/daffodil/git/refs{/sha}","trees_url":"https://api.github.com/repos/graycoreio/daffodil/git/trees{/sha}","statuses_url":"https://api.github.com/repos/graycoreio/daffodil/statuses/{sha}","languages_url":"https://api.github.com/repos/graycoreio/daffodil/languages","stargazers_url":"https://api.github.com/repos/graycoreio/daffodil/stargazers","contributors_url":"https://api.github.com/repos/graycoreio/daffodil/contributors","subscribers_url":"https://api.github.com/repos/graycoreio/daffodil/subscribers","subscription_url":"https://api.github.com/repos/graycoreio/daffodil/subscription","commits_url":"https://api.github.com/repos/graycoreio/daffodil/commits{/sha}","git_commits_url":"https://api.github.com/repos/graycoreio/daffodil/git/commits{/sha}","comments_url":"https://api.github.com/repos/graycoreio/daffodil/comments{/number}","issue_comment_url":"https://api.github.com/repos/graycoreio/daffodil/issues/comments{/number}","contents_url":"https://api.github.com/repos/graycoreio/daffodil/contents/{+path}","compare_url":"https://api.github.com/repos/graycoreio/daffodil/compare/{base}...{head}","merges_url":"https://api.github.com/repos/graycoreio/daffodil/merges","archive_url":"https://api.github.com/repos/graycoreio/daffodil/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/graycoreio/daffodil/downloads","issues_url":"https://api.github.com/repos/graycoreio/daffodil/issues{/number}","pulls_url":"https://api.github.com/repos/graycoreio/daffodil/pulls{/number}","milestones_url":"https://api.github.com/repos/graycoreio/daffodil/milestones{/number}","notifications_url":"https://api.github.com/repos/graycoreio/daffodil/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/graycoreio/daffodil/labels{/name}","releases_url":"https://api.github.com/repos/graycoreio/daffodil/releases{/id}","deployments_url":"https://api.github.com/repos/graycoreio/daffodil/deployments","created_at":"2018-04-09T20:36:05Z","updated_at":"2018-12-20T19:01:48Z","pushed_at":"2018-12-20T22:46:14Z","git_url":"git://github.com/graycoreio/daffodil.git","ssh_url":"git@github.com:graycoreio/daffodil.git","clone_url":"https://github.com/graycoreio/daffodil.git","svn_url":"https://github.com/graycoreio/daffodil","homepage":"","size":24197,"stargazers_count":20,"watchers_count":20,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":34,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":4,"open_issues":34,"watchers":20,"default_branch":"develop"}},"base":{"label":"graycoreio:develop","ref":"develop","sha":"adcecaed6dacd550db1321ba3ce6814a198fbe5b","user":{"login":"graycoreio","id":33813698,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzODEzNjk4","avatar_url":"https://avatars2.githubusercontent.com/u/33813698?v=4","gravatar_id":"","url":"https://api.github.com/users/graycoreio","html_url":"https://github.com/graycoreio","followers_url":"https://api.github.com/users/graycoreio/followers","following_url":"https://api.github.com/users/graycoreio/following{/other_user}","gists_url":"https://api.github.com/users/graycoreio/gists{/gist_id}","starred_url":"https://api.github.com/users/graycoreio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graycoreio/subscriptions","organizations_url":"https://api.github.com/users/graycoreio/orgs","repos_url":"https://api.github.com/users/graycoreio/repos","events_url":"https://api.github.com/users/graycoreio/events{/privacy}","received_events_url":"https://api.github.com/users/graycoreio/received_events","type":"Organization","site_admin":false},"repo":{"id":128830675,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg4MzA2NzU=","name":"daffodil","full_name":"graycoreio/daffodil","private":false,"owner":{"login":"graycoreio","id":33813698,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzODEzNjk4","avatar_url":"https://avatars2.githubusercontent.com/u/33813698?v=4","gravatar_id":"","url":"https://api.github.com/users/graycoreio","html_url":"https://github.com/graycoreio","followers_url":"https://api.github.com/users/graycoreio/followers","following_url":"https://api.github.com/users/graycoreio/following{/other_user}","gists_url":"https://api.github.com/users/graycoreio/gists{/gist_id}","starred_url":"https://api.github.com/users/graycoreio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graycoreio/subscriptions","organizations_url":"https://api.github.com/users/graycoreio/orgs","repos_url":"https://api.github.com/users/graycoreio/repos","events_url":"https://api.github.com/users/graycoreio/events{/privacy}","received_events_url":"https://api.github.com/users/graycoreio/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/graycoreio/daffodil","description":"A frontend development toolkit for Progressive Web Applications for Ecommerce - built with Angular","fork":false,"url":"https://api.github.com/repos/graycoreio/daffodil","forks_url":"https://api.github.com/repos/graycoreio/daffodil/forks","keys_url":"https://api.github.com/repos/graycoreio/daffodil/keys{/key_id}","collaborators_url":"https://api.github.com/repos/graycoreio/daffodil/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/graycoreio/daffodil/teams","hooks_url":"https://api.github.com/repos/graycoreio/daffodil/hooks","issue_events_url":"https://api.github.com/repos/graycoreio/daffodil/issues/events{/number}","events_url":"https://api.github.com/repos/graycoreio/daffodil/events","assignees_url":"https://api.github.com/repos/graycoreio/daffodil/assignees{/user}","branches_url":"https://api.github.com/repos/graycoreio/daffodil/branches{/branch}","tags_url":"https://api.github.com/repos/graycoreio/daffodil/tags","blobs_url":"https://api.github.com/repos/graycoreio/daffodil/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/graycoreio/daffodil/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/graycoreio/daffodil/git/refs{/sha}","trees_url":"https://api.github.com/repos/graycoreio/daffodil/git/trees{/sha}","statuses_url":"https://api.github.com/repos/graycoreio/daffodil/statuses/{sha}","languages_url":"https://api.github.com/repos/graycoreio/daffodil/languages","stargazers_url":"https://api.github.com/repos/graycoreio/daffodil/stargazers","contributors_url":"https://api.github.com/repos/graycoreio/daffodil/contributors","subscribers_url":"https://api.github.com/repos/graycoreio/daffodil/subscribers","subscription_url":"https://api.github.com/repos/graycoreio/daffodil/subscription","commits_url":"https://api.github.com/repos/graycoreio/daffodil/commits{/sha}","git_commits_url":"https://api.github.com/repos/graycoreio/daffodil/git/commits{/sha}","comments_url":"https://api.github.com/repos/graycoreio/daffodil/comments{/number}","issue_comment_url":"https://api.github.com/repos/graycoreio/daffodil/issues/comments{/number}","contents_url":"https://api.github.com/repos/graycoreio/daffodil/contents/{+path}","compare_url":"https://api.github.com/repos/graycoreio/daffodil/compare/{base}...{head}","merges_url":"https://api.github.com/repos/graycoreio/daffodil/merges","archive_url":"https://api.github.com/repos/graycoreio/daffodil/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/graycoreio/daffodil/downloads","issues_url":"https://api.github.com/repos/graycoreio/daffodil/issues{/number}","pulls_url":"https://api.github.com/repos/graycoreio/daffodil/pulls{/number}","milestones_url":"https://api.github.com/repos/graycoreio/daffodil/milestones{/number}","notifications_url":"https://api.github.com/repos/graycoreio/daffodil/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/graycoreio/daffodil/labels{/name}","releases_url":"https://api.github.com/repos/graycoreio/daffodil/releases{/id}","deployments_url":"https://api.github.com/repos/graycoreio/daffodil/deployments","created_at":"2018-04-09T20:36:05Z","updated_at":"2018-12-20T19:01:48Z","pushed_at":"2018-12-20T22:46:14Z","git_url":"git://github.com/graycoreio/daffodil.git","ssh_url":"git@github.com:graycoreio/daffodil.git","clone_url":"https://github.com/graycoreio/daffodil.git","svn_url":"https://github.com/graycoreio/daffodil","homepage":"","size":24197,"stargazers_count":20,"watchers_count":20,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":34,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":4,"open_issues":34,"watchers":20,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/graycoreio/daffodil/pulls/150"},"html":{"href":"https://github.com/graycoreio/daffodil/pull/150"},"issue":{"href":"https://api.github.com/repos/graycoreio/daffodil/issues/150"},"comments":{"href":"https://api.github.com/repos/graycoreio/daffodil/issues/150/comments"},"review_comments":{"href":"https://api.github.com/repos/graycoreio/daffodil/pulls/150/comments"},"review_comment":{"href":"https://api.github.com/repos/graycoreio/daffodil/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/graycoreio/daffodil/pulls/150/commits"},"statuses":{"href":"https://api.github.com/repos/graycoreio/daffodil/statuses/4c1ab126e6223ab31b7f98cbc325d910b8698d73"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"lderrickable"}}