refactor: fix broken formatting
This commit is contained in:
parent
a0585c9a9a
commit
880e8a5cfc
|
@ -6,13 +6,14 @@
|
|||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ViewEncapsulation, ChangeDetectionStrategy} from '../../core';
|
||||
import {ChangeDetectionStrategy, ViewEncapsulation} from '../../core';
|
||||
import {InterpolationConfig} from '../../ml_parser/interpolation_config';
|
||||
import * as o from '../../output/output_ast';
|
||||
import {ParseSourceSpan} from '../../parse_util';
|
||||
import * as t from '../r3_ast';
|
||||
import {R3DependencyMetadata} from '../r3_factory';
|
||||
|
||||
|
||||
/**
|
||||
* Information needed to compile a directive for the render3 runtime.
|
||||
*/
|
||||
|
|
|
@ -1298,21 +1298,21 @@ const TEST_COMPILER_PROVIDERS: Provider[] = [
|
|||
}));
|
||||
|
||||
it('Reattaches in the original cd mode', fakeAsync(() => {
|
||||
const ctx = createCompFixture('<push-cmp></push-cmp>');
|
||||
const cmp: PushComp = queryDirs(ctx.debugElement, PushComp)[0];
|
||||
cmp.changeDetectorRef.detach();
|
||||
cmp.changeDetectorRef.reattach();
|
||||
const ctx = createCompFixture('<push-cmp></push-cmp>');
|
||||
const cmp: PushComp = queryDirs(ctx.debugElement, PushComp)[0];
|
||||
cmp.changeDetectorRef.detach();
|
||||
cmp.changeDetectorRef.reattach();
|
||||
|
||||
// renderCount should NOT be incremented with each CD as CD mode
|
||||
// should be resetted to
|
||||
// on-push
|
||||
ctx.detectChanges();
|
||||
expect(cmp.renderCount).toBeGreaterThan(0);
|
||||
const count = cmp.renderCount;
|
||||
// renderCount should NOT be incremented with each CD as CD mode
|
||||
// should be resetted to
|
||||
// on-push
|
||||
ctx.detectChanges();
|
||||
expect(cmp.renderCount).toBeGreaterThan(0);
|
||||
const count = cmp.renderCount;
|
||||
|
||||
ctx.detectChanges();
|
||||
expect(cmp.renderCount).toBe(count);
|
||||
}));
|
||||
ctx.detectChanges();
|
||||
expect(cmp.renderCount).toBe(count);
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -699,29 +699,28 @@ function declareTests(config?: {useJit: boolean}) {
|
|||
});
|
||||
|
||||
it('should be checked when an async pipe requests a check', fakeAsync(() => {
|
||||
TestBed.configureTestingModule(
|
||||
{declarations: [MyComp, PushCmpWithAsyncPipe], imports: [CommonModule]});
|
||||
const template = '<push-cmp-with-async #cmp></push-cmp-with-async>';
|
||||
TestBed.overrideComponent(MyComp, {set: {template}});
|
||||
const fixture = TestBed.createComponent(MyComp);
|
||||
TestBed.configureTestingModule(
|
||||
{declarations: [MyComp, PushCmpWithAsyncPipe], imports: [CommonModule]});
|
||||
const template = '<push-cmp-with-async #cmp></push-cmp-with-async>';
|
||||
TestBed.overrideComponent(MyComp, {set: {template}});
|
||||
const fixture = TestBed.createComponent(MyComp);
|
||||
|
||||
tick();
|
||||
tick();
|
||||
|
||||
const cmp: PushCmpWithAsyncPipe =
|
||||
fixture.debugElement.children[0].references !['cmp'];
|
||||
fixture.detectChanges();
|
||||
expect(cmp.numberOfChecks).toEqual(1);
|
||||
const cmp: PushCmpWithAsyncPipe = fixture.debugElement.children[0].references !['cmp'];
|
||||
fixture.detectChanges();
|
||||
expect(cmp.numberOfChecks).toEqual(1);
|
||||
|
||||
fixture.detectChanges();
|
||||
fixture.detectChanges();
|
||||
expect(cmp.numberOfChecks).toEqual(1);
|
||||
fixture.detectChanges();
|
||||
fixture.detectChanges();
|
||||
expect(cmp.numberOfChecks).toEqual(1);
|
||||
|
||||
cmp.resolve(2);
|
||||
tick();
|
||||
cmp.resolve(2);
|
||||
tick();
|
||||
|
||||
fixture.detectChanges();
|
||||
expect(cmp.numberOfChecks).toEqual(2);
|
||||
}));
|
||||
fixture.detectChanges();
|
||||
expect(cmp.numberOfChecks).toEqual(2);
|
||||
}));
|
||||
});
|
||||
|
||||
it('should create a component that injects an @Host', () => {
|
||||
|
|
Loading…
Reference in New Issue