
committed by
Miško Hevery

parent
392d584572
commit
aa8bba4865
@ -1175,6 +1175,21 @@ export function main() {
|
||||
expect(renderLog.log).toEqual([]);
|
||||
}));
|
||||
|
||||
it('Detached should disable OnPush', fakeAsync(() => {
|
||||
const ctx = createCompFixture('<push-cmp [value]="value"></push-cmp>');
|
||||
ctx.componentInstance.value = 0;
|
||||
ctx.detectChanges();
|
||||
renderLog.clear();
|
||||
|
||||
const cmp: CompWithRef = queryDirs(ctx.debugElement, PushComp)[0];
|
||||
cmp.changeDetectorRef.detach();
|
||||
|
||||
ctx.componentInstance.value = 1;
|
||||
ctx.detectChanges();
|
||||
|
||||
expect(renderLog.log).toEqual([]);
|
||||
}));
|
||||
|
||||
it('Detached view can be checked locally', fakeAsync(() => {
|
||||
const ctx = createCompFixture('<wrap-comp-with-ref></wrap-comp-with-ref>');
|
||||
const cmp: CompWithRef = queryDirs(ctx.debugElement, CompWithRef)[0];
|
||||
@ -1225,7 +1240,6 @@ export function main() {
|
||||
|
||||
ctx.detectChanges();
|
||||
expect(cmp.renderCount).toBe(count);
|
||||
|
||||
}));
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user