style(lint): re-format modules/@angular

This commit is contained in:
Alex Eagle
2016-06-08 16:38:52 -07:00
parent bbed364e7b
commit f39c9c9e75
589 changed files with 21829 additions and 24259 deletions

View File

@ -1,30 +1,11 @@
import {
beforeEach,
ddescribe,
xdescribe,
describe,
expect,
iit,
inject,
beforeEachProviders,
it,
xit,
} from '@angular/core/testing/testing_internal';
import {beforeEach, ddescribe, xdescribe, describe, expect, iit, inject, beforeEachProviders, it, xit,} from '@angular/core/testing/testing_internal';
import {TestComponentBuilder} from '@angular/compiler/testing';
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
import {SpyRouter, SpyLocation} from '../spies';
import {provide, Component} from '@angular/core';
import {Location} from '@angular/common';
import {
Router,
RouteRegistry,
RouterLink,
RouterOutlet,
Route,
RouteParams,
ComponentInstruction
} from '@angular/router-deprecated';
import {Router, RouteRegistry, RouterLink, RouterOutlet, Route, RouteParams, ComponentInstruction} from '@angular/router-deprecated';
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
import {ResolvedInstruction} from '@angular/router-deprecated/src/instruction';
import {By} from '@angular/platform-browser/src/dom/debug/by';
@ -36,31 +17,33 @@ export function main() {
describe('routerLink directive', function() {
var tcb: TestComponentBuilder;
beforeEachProviders(() => [
{provide: Location, useValue: makeDummyLocation()},
{provide: Router, useValue: makeDummyRouter()}
]);
beforeEachProviders(() => [{provide: Location, useValue: makeDummyLocation()}, {
provide: Router,
useValue: makeDummyRouter()
}]);
beforeEach(inject([TestComponentBuilder], (tcBuilder: any /** TODO #9100 */) => { tcb = tcBuilder; }));
beforeEach(
inject([TestComponentBuilder], (tcBuilder: any /** TODO #9100 */) => { tcb = tcBuilder; }));
it('should update a[href] attribute', inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
it('should update a[href] attribute',
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
tcb.createAsync(TestComponent)
.then((testComponent) => {
testComponent.detectChanges();
let anchorElement =
testComponent.debugElement.query(By.css('a.detail-view')).nativeElement;
expect(getDOM().getAttribute(anchorElement, 'href')).toEqual('detail');
async.done();
});
tcb.createAsync(TestComponent).then((testComponent) => {
testComponent.detectChanges();
let anchorElement =
testComponent.debugElement.query(By.css('a.detail-view')).nativeElement;
expect(getDOM().getAttribute(anchorElement, 'href')).toEqual('detail');
async.done();
});
}));
it('should call router.navigate when a link is clicked',
inject([AsyncTestCompleter, Router], (async: AsyncTestCompleter, router: any /** TODO #9100 */) => {
inject(
[AsyncTestCompleter, Router],
(async: AsyncTestCompleter, router: any /** TODO #9100 */) => {
tcb.createAsync(TestComponent)
.then((testComponent) => {
tcb.createAsync(TestComponent).then((testComponent) => {
testComponent.detectChanges();
// TODO: shouldn't this be just 'click' rather than '^click'?
testComponent.debugElement.query(By.css('a.detail-view'))
@ -68,37 +51,39 @@ export function main() {
expect(router.spy('navigateByInstruction')).toHaveBeenCalledWith(dummyInstruction);
async.done();
});
}));
}));
it('should call router.navigate when a link is clicked if target is _self',
inject([AsyncTestCompleter, Router], (async: AsyncTestCompleter, router: any /** TODO #9100 */) => {
inject(
[AsyncTestCompleter, Router],
(async: AsyncTestCompleter, router: any /** TODO #9100 */) => {
tcb.createAsync(TestComponent)
.then((testComponent) => {
tcb.createAsync(TestComponent).then((testComponent) => {
testComponent.detectChanges();
testComponent.debugElement.query(By.css('a.detail-view-self'))
.triggerEventHandler('click', null);
expect(router.spy('navigateByInstruction')).toHaveBeenCalledWith(dummyInstruction);
async.done();
});
}));
}));
it('should NOT call router.navigate when a link is clicked if target is set to other than _self',
inject([AsyncTestCompleter, Router], (async: AsyncTestCompleter, router: any /** TODO #9100 */) => {
inject(
[AsyncTestCompleter, Router],
(async: AsyncTestCompleter, router: any /** TODO #9100 */) => {
tcb.createAsync(TestComponent)
.then((testComponent) => {
tcb.createAsync(TestComponent).then((testComponent) => {
testComponent.detectChanges();
testComponent.debugElement.query(By.css('a.detail-view-blank'))
.triggerEventHandler('click', null);
expect(router.spy('navigateByInstruction')).not.toHaveBeenCalled();
async.done();
});
}));
}));
});
}
@Component({selector: 'user-cmp', template: "hello {{user}}"})
@Component({selector: 'user-cmp', template: 'hello {{user}}'})
class UserCmp {
user: string;
constructor(params: RouteParams) { this.user = params.get('name'); }