{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/5662","labels_url":"https://api.github.com/repos/angular/angular/issues/5662/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/5662/comments","events_url":"https://api.github.com/repos/angular/angular/issues/5662/events","html_url":"https://github.com/angular/angular/issues/5662","id":120770764,"number":5662,"title":"TestComponentBuilder/inject does not work, when component has templateUrl","user":{"login":"goodfield","id":1791995,"avatar_url":"https://avatars.githubusercontent.com/u/1791995?v=3","gravatar_id":"","url":"https://api.github.com/users/goodfield","html_url":"https://github.com/goodfield","followers_url":"https://api.github.com/users/goodfield/followers","following_url":"https://api.github.com/users/goodfield/following{/other_user}","gists_url":"https://api.github.com/users/goodfield/gists{/gist_id}","starred_url":"https://api.github.com/users/goodfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goodfield/subscriptions","organizations_url":"https://api.github.com/users/goodfield/orgs","repos_url":"https://api.github.com/users/goodfield/repos","events_url":"https://api.github.com/users/goodfield/events{/privacy}","received_events_url":"https://api.github.com/users/goodfield/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-07T13:11:56Z","updated_at":"2016-01-07T11:02:09Z","closed_at":null,"body":"Following test fails as expected (http://plnkr.co/edit/61ByTt?p=preview):\r\n```\r\n@Component({\r\n  selector: 'header',\r\n  template: '<h1>Hello Welt!</h1>'\r\n})\r\nexport class TestComponent2 {\r\n }\r\n\r\ndescribe('TestComponent', () => {\r\n  it('should fail', inject([TestComponentBuilder], (tcb) => {\r\n    return tcb.createAsync(TestComponent2).then((fixture) => {\r\n      fixture.detectChanges();\r\n      expect(1).toEqual(2);\r\n    });\r\n  }));\r\n)};\r\n```\r\nMoving the template to an external resource, the test passes without failing (the async part doesn't get executed) (http://plnkr.co/edit/ZOeFTO?p=preview):\r\n\r\n```\r\n@Component({\r\n  selector: 'header',\r\n  templateUrl: 'src/test.html'\r\n})\r\nexport class TestComponent {\r\n  \r\n}\r\n\r\ndescribe('TestComponent', () => {\r\n  it('should fail', inject([TestComponentBuilder], (tcb) => {\r\n    return tcb.createAsync(TestComponent).then((fixture) => {\r\n      fixture.detectChanges();\r\n      expect(1).toEqual(2);\r\n    });\r\n  }));\r\n)};\r\n```\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/169630790","html_url":"https://github.com/angular/angular/issues/5662#issuecomment-169630790","issue_url":"https://api.github.com/repos/angular/angular/issues/5662","id":169630790,"user":{"login":"GaloisGirl","id":3268958,"avatar_url":"https://avatars.githubusercontent.com/u/3268958?v=3","gravatar_id":"","url":"https://api.github.com/users/GaloisGirl","html_url":"https://github.com/GaloisGirl","followers_url":"https://api.github.com/users/GaloisGirl/followers","following_url":"https://api.github.com/users/GaloisGirl/following{/other_user}","gists_url":"https://api.github.com/users/GaloisGirl/gists{/gist_id}","starred_url":"https://api.github.com/users/GaloisGirl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GaloisGirl/subscriptions","organizations_url":"https://api.github.com/users/GaloisGirl/orgs","repos_url":"https://api.github.com/users/GaloisGirl/repos","events_url":"https://api.github.com/users/GaloisGirl/events{/privacy}","received_events_url":"https://api.github.com/users/GaloisGirl/received_events","type":"User","site_admin":false},"created_at":"2016-01-07T11:02:09Z","updated_at":"2016-01-07T11:02:09Z","body":"Also suffering from this.\r\nWhen using the overrideTemplate workaround, tests pass or fail nondeterministically - an improvement over not being ran at all, but still incorrect.\r\nI'm using 2.0.0-beta.0."}}