Skip to content

Commit

Permalink
Update regression_integration_spec.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
KiaraGrouwstra committed Jun 10, 2016
1 parent 74864d0 commit 6fc7083
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion modules/@angular/core/test/linker/regression_integration_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import {
ViewMetadata,
PLATFORM_PIPES,
OpaqueToken,
Injector
Injector,
forwardRef
} from '@angular/core';
import {NgIf, NgClass} from '@angular/common';
import {CompilerConfig} from '@angular/compiler';
Expand Down Expand Up @@ -178,6 +179,15 @@ function declareTests(isJit: boolean) {
});
}));

it('should handle mutual recursion entered from multiple sides - #7084',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
tcb.createAsync(FakeRecursiveComp)
.then((fixture) => {
fixture.detectChanges();
expect(fixture.nativeElement).toHaveText('[]');
async.done();
});
}));

});
}
Expand All @@ -200,3 +210,31 @@ class CustomPipe implements PipeTransform {
@Component({selector: 'cmp-content', template: `<ng-content></ng-content>`})
class CmpWithNgContent {
}

@Component({
selector: 'left',
template: `L<right *ngIf="false"></right>`,
directives: [
forwardRef(() => RightComp),
]
})
class LeftComp {}

@Component({
selector: 'right',
template: `R<left *ngIf="false"></left>`,
directives: [
forwardRef(() => LeftComp),
]
})
class RightComp {}

@Component({
selector: 'fakeRecursiveComp',
template: `[<left *ngIf="false"></left><right *ngIf="false"></right>]`,
directives: [
forwardRef(() => LeftComp),
forwardRef(() => RightComp),
]
})
class FakeRecursiveComp {}

0 comments on commit 6fc7083

Please sign in to comment.