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
|
* 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 {InterpolationConfig} from '../../ml_parser/interpolation_config';
|
||||||
import * as o from '../../output/output_ast';
|
import * as o from '../../output/output_ast';
|
||||||
import {ParseSourceSpan} from '../../parse_util';
|
import {ParseSourceSpan} from '../../parse_util';
|
||||||
import * as t from '../r3_ast';
|
import * as t from '../r3_ast';
|
||||||
import {R3DependencyMetadata} from '../r3_factory';
|
import {R3DependencyMetadata} from '../r3_factory';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Information needed to compile a directive for the render3 runtime.
|
* 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(() => {
|
it('Reattaches in the original cd mode', fakeAsync(() => {
|
||||||
const ctx = createCompFixture('<push-cmp></push-cmp>');
|
const ctx = createCompFixture('<push-cmp></push-cmp>');
|
||||||
const cmp: PushComp = queryDirs(ctx.debugElement, PushComp)[0];
|
const cmp: PushComp = queryDirs(ctx.debugElement, PushComp)[0];
|
||||||
cmp.changeDetectorRef.detach();
|
cmp.changeDetectorRef.detach();
|
||||||
cmp.changeDetectorRef.reattach();
|
cmp.changeDetectorRef.reattach();
|
||||||
|
|
||||||
// renderCount should NOT be incremented with each CD as CD mode
|
// renderCount should NOT be incremented with each CD as CD mode
|
||||||
// should be resetted to
|
// should be resetted to
|
||||||
// on-push
|
// on-push
|
||||||
ctx.detectChanges();
|
ctx.detectChanges();
|
||||||
expect(cmp.renderCount).toBeGreaterThan(0);
|
expect(cmp.renderCount).toBeGreaterThan(0);
|
||||||
const count = cmp.renderCount;
|
const count = cmp.renderCount;
|
||||||
|
|
||||||
ctx.detectChanges();
|
ctx.detectChanges();
|
||||||
expect(cmp.renderCount).toBe(count);
|
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(() => {
|
it('should be checked when an async pipe requests a check', fakeAsync(() => {
|
||||||
TestBed.configureTestingModule(
|
TestBed.configureTestingModule(
|
||||||
{declarations: [MyComp, PushCmpWithAsyncPipe], imports: [CommonModule]});
|
{declarations: [MyComp, PushCmpWithAsyncPipe], imports: [CommonModule]});
|
||||||
const template = '<push-cmp-with-async #cmp></push-cmp-with-async>';
|
const template = '<push-cmp-with-async #cmp></push-cmp-with-async>';
|
||||||
TestBed.overrideComponent(MyComp, {set: {template}});
|
TestBed.overrideComponent(MyComp, {set: {template}});
|
||||||
const fixture = TestBed.createComponent(MyComp);
|
const fixture = TestBed.createComponent(MyComp);
|
||||||
|
|
||||||
tick();
|
tick();
|
||||||
|
|
||||||
const cmp: PushCmpWithAsyncPipe =
|
const cmp: PushCmpWithAsyncPipe = fixture.debugElement.children[0].references !['cmp'];
|
||||||
fixture.debugElement.children[0].references !['cmp'];
|
fixture.detectChanges();
|
||||||
fixture.detectChanges();
|
expect(cmp.numberOfChecks).toEqual(1);
|
||||||
expect(cmp.numberOfChecks).toEqual(1);
|
|
||||||
|
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(cmp.numberOfChecks).toEqual(1);
|
expect(cmp.numberOfChecks).toEqual(1);
|
||||||
|
|
||||||
cmp.resolve(2);
|
cmp.resolve(2);
|
||||||
tick();
|
tick();
|
||||||
|
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(cmp.numberOfChecks).toEqual(2);
|
expect(cmp.numberOfChecks).toEqual(2);
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create a component that injects an @Host', () => {
|
it('should create a component that injects an @Host', () => {
|
||||||
|
|
Loading…
Reference in New Issue