refactor(): use const and let instead of var
This commit is contained in:

committed by
Victor Berchet

parent
73593d4bf3
commit
77ee27c59e
@ -19,9 +19,9 @@ describe('template codegen output', () => {
|
||||
|
||||
it('should apply the animate states to the element', (done) => {
|
||||
const compFixture = createComponent(AnimateCmp);
|
||||
var debugElement = compFixture.debugElement;
|
||||
const debugElement = compFixture.debugElement;
|
||||
|
||||
var targetDebugElement = findTargetElement(<DebugElement>debugElement);
|
||||
const targetDebugElement = findTargetElement(<DebugElement>debugElement);
|
||||
|
||||
compFixture.componentInstance.setAsOpen();
|
||||
compFixture.detectChanges();
|
||||
@ -45,9 +45,9 @@ describe('template codegen output', () => {
|
||||
|
||||
it('should apply the default animate state to the element', (done) => {
|
||||
const compFixture = createComponent(AnimateCmp);
|
||||
var debugElement = compFixture.debugElement;
|
||||
const debugElement = compFixture.debugElement;
|
||||
|
||||
var targetDebugElement = findTargetElement(<DebugElement>debugElement);
|
||||
const targetDebugElement = findTargetElement(<DebugElement>debugElement);
|
||||
|
||||
compFixture.componentInstance.setAsSomethingElse();
|
||||
compFixture.detectChanges();
|
||||
|
@ -15,8 +15,8 @@ import {createComponent} from './util';
|
||||
|
||||
describe('content projection', () => {
|
||||
it('should support entryComponents in components', () => {
|
||||
var compFixture = createComponent(CompWithEntryComponents);
|
||||
var cf = compFixture.componentInstance.cfr.resolveComponentFactory(BasicComp);
|
||||
const compFixture = createComponent(CompWithEntryComponents);
|
||||
const cf = compFixture.componentInstance.cfr.resolveComponentFactory(BasicComp);
|
||||
expect(cf.componentType).toBe(BasicComp);
|
||||
});
|
||||
|
||||
|
@ -13,10 +13,10 @@ import {createComponent} from './util';
|
||||
|
||||
describe('content projection', () => {
|
||||
it('should support basic content projection', () => {
|
||||
var mainCompFixture = createComponent(ProjectingComp);
|
||||
const mainCompFixture = createComponent(ProjectingComp);
|
||||
|
||||
var debugElement = mainCompFixture.debugElement;
|
||||
var compWithProjection = debugElement.query(By.directive(CompWithNgContent));
|
||||
const debugElement = mainCompFixture.debugElement;
|
||||
const compWithProjection = debugElement.query(By.directive(CompWithNgContent));
|
||||
expect(compWithProjection.children.length).toBe(1);
|
||||
expect(compWithProjection.children[0].attributes['greeting']).toEqual('Hello world!');
|
||||
});
|
||||
|
@ -14,18 +14,18 @@ import {createComponent} from './util';
|
||||
|
||||
describe('child queries', () => {
|
||||
it('should support compiling child queries', () => {
|
||||
var childQueryCompFixture = createComponent(CompWithChildQuery);
|
||||
var debugElement = childQueryCompFixture.debugElement;
|
||||
var compWithChildren = debugElement.query(By.directive(CompWithChildQuery));
|
||||
const childQueryCompFixture = createComponent(CompWithChildQuery);
|
||||
const debugElement = childQueryCompFixture.debugElement;
|
||||
const compWithChildren = debugElement.query(By.directive(CompWithChildQuery));
|
||||
expect(childQueryCompFixture.componentInstance.child).toBeDefined();
|
||||
expect(childQueryCompFixture.componentInstance.child instanceof CompForChildQuery).toBe(true);
|
||||
|
||||
});
|
||||
|
||||
it('should support compiling children queries', () => {
|
||||
var childQueryCompFixture = createComponent(CompWithChildQuery);
|
||||
var debugElement = childQueryCompFixture.debugElement;
|
||||
var compWithChildren = debugElement.query(By.directive(CompWithChildQuery));
|
||||
const childQueryCompFixture = createComponent(CompWithChildQuery);
|
||||
const debugElement = childQueryCompFixture.debugElement;
|
||||
const compWithChildren = debugElement.query(By.directive(CompWithChildQuery));
|
||||
|
||||
childQueryCompFixture.detectChanges();
|
||||
|
||||
|
Reference in New Issue
Block a user