|
| 1 | +/* tslint:disable:no-unused-variable */ |
| 2 | + |
| 3 | +import { By } from '@angular/platform-browser'; |
| 4 | +import { DebugElement } from '@angular/core'; |
| 5 | + |
1 | 6 | import { |
2 | | - beforeEach, |
3 | | - beforeEachProviders, |
4 | | - describe, |
5 | | - expect, |
6 | | - it, |
7 | | - inject |
| 7 | + beforeEach, beforeEachProviders, |
| 8 | + describe, ddescribe, xdescribe, |
| 9 | + expect, it, iit, xit, |
| 10 | + async, inject |
8 | 11 | } from '@angular/core/testing'; |
9 | | -import { ComponentFixture, TestComponentBuilder } from '@angular/compiler/testing'; |
10 | | -import { Component } from '@angular/core'; |
11 | | -import { By } from '@angular/platform-browser'; |
| 12 | + |
12 | 13 | import { <%= classifiedModuleName %>Component } from './<%= dasherizedModuleName %>.component'; |
13 | 14 |
|
14 | 15 | describe('Component: <%= classifiedModuleName %>', () => { |
15 | | - let builder: TestComponentBuilder; |
16 | | - |
17 | | - beforeEachProviders(() => [<%= classifiedModuleName %>Component]); |
18 | | - beforeEach(inject([TestComponentBuilder], function (tcb: TestComponentBuilder) { |
19 | | - builder = tcb; |
20 | | - })); |
21 | | - |
22 | | - it('should inject the component', inject([<%= classifiedModuleName %>Component], |
23 | | - (component: <%= classifiedModuleName %>Component) => { |
| 16 | + it('should create an instance', () => { |
| 17 | + let component = new <%= classifiedModuleName %>Component(); |
24 | 18 | expect(component).toBeTruthy(); |
25 | | - })); |
26 | | - |
27 | | - it('should create the component', inject([], () => { |
28 | | - return builder.createAsync(<%= classifiedModuleName %>ComponentTestController) |
29 | | - .then((fixture: ComponentFixture<any>) => { |
30 | | - let query = fixture.debugElement.query(By.directive(<%= classifiedModuleName %>Component)); |
31 | | - expect(query).toBeTruthy(); |
32 | | - expect(query.componentInstance).toBeTruthy(); |
33 | | - }); |
34 | | - })); |
| 19 | + }); |
35 | 20 | }); |
36 | | - |
37 | | -@Component({ |
38 | | - selector: 'test', |
39 | | - template: ` |
40 | | - <<%= selector %>></<%= selector %>> |
41 | | - `, |
42 | | - directives: [<%= classifiedModuleName %>Component] |
43 | | -}) |
44 | | -class <%= classifiedModuleName %>ComponentTestController { |
45 | | -} |
46 | | - |
0 commit comments