{"id":15106958,"url":"https://github.com/normandy72/testing-components","last_synced_at":"2026-01-18T17:32:47.464Z","repository":{"id":153902831,"uuid":"594024726","full_name":"Normandy72/Testing-Components","owner":"Normandy72","description":"Testing AngularJS Components. Coursera course \"Single Page Web Applications with AngularJS\" by Yaakov Chaikin.","archived":false,"fork":false,"pushed_at":"2023-01-27T12:42:53.000Z","size":159,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-11T09:42:18.853Z","etag":null,"topics":["angular","angularjs","html","html5","jasmine","jasmine-tests","javascript","js","testing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Normandy72.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-27T12:23:35.000Z","updated_at":"2023-01-27T12:38:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"b6cdcab1-8703-4a83-800a-886b2c86b946","html_url":"https://github.com/Normandy72/Testing-Components","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"43d620c431db1e390e326f0320390041bbc5f9c9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FTesting-Components","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FTesting-Components/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FTesting-Components/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FTesting-Components/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Normandy72","download_url":"https://codeload.github.com/Normandy72/Testing-Components/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345703,"owners_count":20924098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","angularjs","html","html5","jasmine","jasmine-tests","javascript","js","testing"],"created_at":"2024-09-25T21:03:36.691Z","updated_at":"2026-01-18T17:32:47.436Z","avatar_url":"https://github.com/Normandy72.png","language":"JavaScript","readme":"# Testing AngularJS Components\n### beforeEach Setup\n```\nvar $componentController;\n\nbeforeEach(module('MyApp'));\n\nbeforeEach(inject(function(_$componentController_){\n    $componentController = _$componentController_;\n}));\n```\n### Test Method\n```\nit('should update value', function(){\n    var bindings = {\n        prop1: {val: 'some val'}\n    };\n\n    var ctrl = $componentController('myComp', {}, bindings);\n\n    var updatedVal1 = ctrl.val;\n\n    expect(updatedVal).toEqual('some val');\n});\n```\n***\n#### _Summary_\nUse the following steps to test a component:\n* In beforeEach:\n    * use mock inject function to inject `$componentController` service.\n* In the test method:\n    * set up a bindings object with expected props (if any);\n    * set up objects controller expects to be injected (if any);\n    * create controller with `$componentController('componentName', injections, bindings)`.\n***","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnormandy72%2Ftesting-components","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnormandy72%2Ftesting-components","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnormandy72%2Ftesting-components/lists"}