diff --git a/addon/ng2/blueprints/component/files/__path__/__name__.component.html b/addon/ng2/blueprints/component/files/__path__/__name__.component.html index faf71afb8d6c..200001f88129 100644 --- a/addon/ng2/blueprints/component/files/__path__/__name__.component.html +++ b/addon/ng2/blueprints/component/files/__path__/__name__.component.html @@ -1,3 +1,3 @@

- <%= dasherizedModuleName %> Works! + <%= dasherizedModuleName %> works!

diff --git a/addon/ng2/blueprints/component/files/__path__/__name__.component.spec.ts b/addon/ng2/blueprints/component/files/__path__/__name__.component.spec.ts index 20f60ef60ea5..33ee6b57ea7d 100644 --- a/addon/ng2/blueprints/component/files/__path__/__name__.component.spec.ts +++ b/addon/ng2/blueprints/component/files/__path__/__name__.component.spec.ts @@ -10,30 +10,13 @@ import { ComponentFixture, TestComponentBuilder } from 'angular2/testing'; -import {provide} from 'angular2/core';<% if (route) { %> -import {Router, RouteParams} from 'angular2/router';<% } %> -import {<%= classifiedModuleName %>Component} from './<%= dasherizedModuleName %>.component';<% if (route) { %> -class MockRouter { - registerPrimaryOutlet() { } -} +import {<%= classifiedModuleName %>Component} from './<%= dasherizedModuleName %>.component'; -class MockRouteParams { - get() { return 1; } -}<% } %> - -describe('<%= classifiedModuleName %> Component', () => { -<% if (route) { %> - beforeEachProviders(() => [ - provide(Router, { useClass: MockRouter }), - provide(RouteParams, { useClass: MockRouteParams }), - ]); -<% } else { %> - beforeEachProviders((): any[] => []); -<% } %> - it('should ...', async(inject([TestComponentBuilder], (tcb:TestComponentBuilder) => { - return tcb.createAsync(<%= classifiedModuleName %>Component).then((fixture: ComponentFixture) => { - fixture.detectChanges(); - }); - }))); +describe('Component: <%= classifiedModuleName %>', () => { + beforeEachProviders(() => [<%= classifiedModuleName %>Component]); + + it('should create the component', inject([<%= classifiedModuleName %>Component], (component: <%= classifiedModuleName %>Component) => { + expect(component).toBeTruthy(); + })); }); diff --git a/addon/ng2/blueprints/ng2/files/src/client/app/__name__.component.html b/addon/ng2/blueprints/ng2/files/src/client/app/__name__.component.html index d6ec35df559a..d942f4a4776d 100644 --- a/addon/ng2/blueprints/ng2/files/src/client/app/__name__.component.html +++ b/addon/ng2/blueprints/ng2/files/src/client/app/__name__.component.html @@ -1,3 +1,3 @@ -

- <%= htmlComponentName %> Works! -

+

+ <%= htmlComponentName %> works! +

diff --git a/addon/ng2/blueprints/ng2/files/src/client/app/__name__.component.spec.ts b/addon/ng2/blueprints/ng2/files/src/client/app/__name__.component.spec.ts index c79227e619fd..43fbd7e4929b 100644 --- a/addon/ng2/blueprints/ng2/files/src/client/app/__name__.component.spec.ts +++ b/addon/ng2/blueprints/ng2/files/src/client/app/__name__.component.spec.ts @@ -1,18 +1,22 @@ -import {describe, it, expect, beforeEachProviders, inject} from 'angular2/testing'; +import { + async, + beforeEachProviders, + describe, + ddescribe, + expect, + iit, + it, + inject, + ComponentFixture, + TestComponentBuilder +} from 'angular2/testing'; import {<%= jsComponentName %>App} from '../app/<%= htmlComponentName %>.component'; beforeEachProviders(() => [<%= jsComponentName %>App]); -describe('App: <%= jsComponentName %>', () => { - it('should have the `defaultMeaning` as 42', inject([<%= jsComponentName %>App], (app: <%= jsComponentName %>App) => { - expect(app.defaultMeaning).toBe(42); - })); - - describe('#meaningOfLife', () => { - it('should get the meaning of life', inject([<%= jsComponentName %>App], (app: <%= jsComponentName %>App) => { - expect(app.meaningOfLife()).toBe('The meaning of life is 42'); - expect(app.meaningOfLife(22)).toBe('The meaning of life is 22'); - })); - }); +describe('App: <%= jsComponentName %>', () => { + it('should create the app', inject([<%= jsComponentName %>App], (app: <%= jsComponentName %>App) => { + expect(app).toBeTruthy(); + })); }); diff --git a/addon/ng2/blueprints/ng2/files/src/client/app/__name__.component.ts b/addon/ng2/blueprints/ng2/files/src/client/app/__name__.component.ts index b63ab780ab03..bd4671245f93 100644 --- a/addon/ng2/blueprints/ng2/files/src/client/app/__name__.component.ts +++ b/addon/ng2/blueprints/ng2/files/src/client/app/__name__.component.ts @@ -7,9 +7,4 @@ import {Component} from 'angular2/core'; styleUrls: ['<%= dasherizedModuleName %>.component.<%= styleExt %>'] }) export class <%= jsComponentName %>App { - defaultMeaning: number = 42; - - meaningOfLife(meaning?: number) { - return `The meaning of life is ${meaning || this.defaultMeaning}`; - } }