
committed by
Misko Hevery

parent
0246b2a2cb
commit
787d1f955f
@ -71,9 +71,9 @@ export function main() {
|
||||
it('should rethrow exceptions from component constructors',
|
||||
inject([AsyncTestCompleter, TestComponentBuilder], (async, tcb: TestComponentBuilder) => {
|
||||
tcb.createAsync(AppCmp).then((rootTC) => {
|
||||
var router = rootTC.componentInstance.router;
|
||||
var router = rootTC.debugElement.componentInstance.router;
|
||||
PromiseWrapper.catchError(router.navigateByUrl('/cause-error'), (error) => {
|
||||
expect(rootTC.nativeElement).toHaveText('outer { oh no }');
|
||||
expect(rootTC.debugElement.nativeElement).toHaveText('outer { oh no }');
|
||||
expect(error).toContainError('oops!');
|
||||
async.done();
|
||||
});
|
||||
@ -89,7 +89,7 @@ export function main() {
|
||||
|
||||
tcb.createAsync(HierarchyAppCmp)
|
||||
.then((rootTC) => {
|
||||
var router = rootTC.componentInstance.router;
|
||||
var router = rootTC.debugElement.componentInstance.router;
|
||||
var position = 0;
|
||||
var flipped = false;
|
||||
var history =
|
||||
@ -100,8 +100,8 @@ export function main() {
|
||||
]
|
||||
|
||||
router.subscribe((_) => {
|
||||
var location = rootTC.componentInstance.location;
|
||||
var element = rootTC.nativeElement;
|
||||
var location = rootTC.debugElement.componentInstance.location;
|
||||
var element = rootTC.debugElement.nativeElement;
|
||||
var path = location.path();
|
||||
|
||||
var entry = history[position];
|
||||
@ -140,10 +140,12 @@ export function main() {
|
||||
|
||||
tcb.createAsync(HierarchyAppCmp)
|
||||
.then((rootTC) => {
|
||||
var router = rootTC.componentInstance.router;
|
||||
var router = rootTC.debugElement.componentInstance.router;
|
||||
router.subscribe((_) => {
|
||||
expect(rootTC.nativeElement).toHaveText('root { parent { hello } }');
|
||||
expect(rootTC.componentInstance.location.path()).toEqual('/parent/child');
|
||||
expect(rootTC.debugElement.nativeElement)
|
||||
.toHaveText('root { parent { hello } }');
|
||||
expect(rootTC.debugElement.componentInstance.location.path())
|
||||
.toEqual('/parent/child');
|
||||
async.done();
|
||||
});
|
||||
router.navigateByUrl('/parent/child');
|
||||
@ -158,10 +160,11 @@ export function main() {
|
||||
|
||||
tcb.createAsync(HierarchyAppCmp)
|
||||
.then((rootTC) => {
|
||||
var router = rootTC.componentInstance.router;
|
||||
var router = rootTC.debugElement.componentInstance.router;
|
||||
router.subscribe((_) => {
|
||||
expect(rootTC.nativeElement).toHaveText('root { parent { hello } }');
|
||||
expect(rootTC.componentInstance.location.path())
|
||||
expect(rootTC.debugElement.nativeElement)
|
||||
.toHaveText('root { parent { hello } }');
|
||||
expect(rootTC.debugElement.componentInstance.location.path())
|
||||
.toEqual('/my/app/parent/child');
|
||||
async.done();
|
||||
});
|
||||
@ -180,11 +183,12 @@ export function main() {
|
||||
inject([AsyncTestCompleter, TestComponentBuilder], (async, tcb: TestComponentBuilder) => {
|
||||
tcb.createAsync(QueryStringAppCmp)
|
||||
.then((rootTC) => {
|
||||
var router = rootTC.componentInstance.router;
|
||||
var router = rootTC.debugElement.componentInstance.router;
|
||||
router.subscribe((_) => {
|
||||
rootTC.detectChanges();
|
||||
|
||||
expect(rootTC.nativeElement).toHaveText('qParam = search-for-something');
|
||||
expect(rootTC.debugElement.nativeElement)
|
||||
.toHaveText('qParam = search-for-something');
|
||||
/*
|
||||
expect(applicationRef.hostComponent.location.path())
|
||||
.toEqual('/qs?q=search-for-something');*/
|
||||
|
Reference in New Issue
Block a user