test: clean up explicit dynamic query usages (#33015)

Cleans up all the places where we explicitly set `static: false` on queries.

PR Close #33015
This commit is contained in:
crisbeto
2019-10-05 10:04:54 +02:00
committed by Matias Niemelä
parent 7e64bbe5a8
commit 9d54679e66
46 changed files with 273 additions and 279 deletions

View File

@ -376,7 +376,7 @@ const DEFAULT_COMPONENT_ID = '1';
]
})
class Cmp {
@ViewChild('element', {static: false})
@ViewChild('element')
element: any;
exp: any = '';
}
@ -1463,7 +1463,7 @@ const DEFAULT_COMPONENT_ID = '1';
])]
})
class Cmp {
@ViewChild('green', {static: false}) public element: any;
@ViewChild('green') public element: any;
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -1799,7 +1799,7 @@ const DEFAULT_COMPONENT_ID = '1';
class Cmp {
public exp: any;
@ViewChild('parent', {static: false}) public parentElement: any;
@ViewChild('parent') public parentElement: any;
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -1853,9 +1853,9 @@ const DEFAULT_COMPONENT_ID = '1';
public exp1: any;
public exp2: any;
@ViewChild('parent', {static: false}) public parent: any;
@ViewChild('parent') public parent: any;
@ViewChild('child', {static: false}) public child: any;
@ViewChild('child') public child: any;
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -1910,11 +1910,11 @@ const DEFAULT_COMPONENT_ID = '1';
public exp1: any;
public exp2: any;
@ViewChild('parent', {static: false}) public parent: any;
@ViewChild('parent') public parent: any;
@ViewChild('child1', {static: false}) public child1Elm: any;
@ViewChild('child1') public child1Elm: any;
@ViewChild('child2', {static: false}) public child2Elm: any;
@ViewChild('child2') public child2Elm: any;
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -2269,7 +2269,7 @@ const DEFAULT_COMPONENT_ID = '1';
[transition(':enter', [style({opacity: 0}), animate('1s', style({opacity: 1}))])])]
})
class OuterCmp {
@ViewChild('inner', {static: false}) public inner: any;
@ViewChild('inner') public inner: any;
public exp: any = null;
update() { this.exp = 'go'; }
@ -3260,7 +3260,7 @@ const DEFAULT_COMPONENT_ID = '1';
]
})
class Cmp {
@ViewChild('parent', {static: false}) public parentElm: any;
@ViewChild('parent') public parentElm: any;
disableExp = false;
exp = false;
}
@ -3351,7 +3351,7 @@ const DEFAULT_COMPONENT_ID = '1';
`
})
class ParentCmp {
@ViewChild('child', {static: false}) public child: ChildCmp|null = null;
@ViewChild('child') public child: ChildCmp|null = null;
disableExp = false;
}
@ -3467,7 +3467,7 @@ const DEFAULT_COMPONENT_ID = '1';
`
})
class Cmp {
@ViewChild('container', {static: false}) public container: any;
@ViewChild('container') public container: any;
disableExp = false;
exp = '';

View File

@ -888,7 +888,7 @@ import {HostListener} from '../../src/metadata/directives';
]
})
class Cmp {
@ViewChild('container', {static: false}) public container: any;
@ViewChild('container') public container: any;
public items: any[] = [];
}
@ -1202,9 +1202,9 @@ import {HostListener} from '../../src/metadata/directives';
public exp1: any = '';
public exp2: any = true;
@ViewChild('ancestor', {static: false}) public ancestorElm: any;
@ViewChild('ancestor') public ancestorElm: any;
@ViewChild('parent', {static: false}) public parentElm: any;
@ViewChild('parent') public parentElm: any;
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -1281,9 +1281,9 @@ import {HostListener} from '../../src/metadata/directives';
public exp2: any = '';
public parentExp: any = true;
@ViewChild('ancestor', {static: false}) public ancestorElm: any;
@ViewChild('ancestor') public ancestorElm: any;
@ViewChild('parent', {static: false}) public parentElm: any;
@ViewChild('parent') public parentElm: any;
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -1637,7 +1637,7 @@ import {HostListener} from '../../src/metadata/directives';
class ParentCmp {
public exp: any;
@ViewChild('child', {static: false}) public child: any;
@ViewChild('child') public child: any;
}
@Component({
@ -1849,9 +1849,9 @@ import {HostListener} from '../../src/metadata/directives';
public exp1: any;
public exp2: any;
@ViewChild('parent', {static: false}) public elm1: any;
@ViewChild('parent') public elm1: any;
@ViewChild('child', {static: false}) public elm2: any;
@ViewChild('child') public elm2: any;
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -1911,7 +1911,7 @@ import {HostListener} from '../../src/metadata/directives';
public exp: any;
public items: any[] = [0, 1, 2, 3, 4];
@ViewChild('parent', {static: false}) public elm: any;
@ViewChild('parent') public elm: any;
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -1981,7 +1981,7 @@ import {HostListener} from '../../src/metadata/directives';
public exp: any;
public items: any[] = [0, 1, 2, 3, 4];
@ViewChild('parent', {static: false}) public elm: any;
@ViewChild('parent') public elm: any;
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -2034,7 +2034,7 @@ import {HostListener} from '../../src/metadata/directives';
public exp1: any;
public exp2: any;
@ViewChild('parent', {static: false}) public elm: any;
@ViewChild('parent') public elm: any;
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -2104,7 +2104,7 @@ import {HostListener} from '../../src/metadata/directives';
public exp1: any;
public exp2: any;
@ViewChild('parent', {static: false}) public elm: any;
@ViewChild('parent') public elm: any;
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -2157,7 +2157,7 @@ import {HostListener} from '../../src/metadata/directives';
public exp1: any;
public exp2: any;
@ViewChild('parent', {static: false}) public elm: any;
@ViewChild('parent') public elm: any;
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -2209,7 +2209,7 @@ import {HostListener} from '../../src/metadata/directives';
public exp1: any;
public exp2: any;
@ViewChild('parent', {static: false}) public elm: any;
@ViewChild('parent') public elm: any;
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -2258,7 +2258,7 @@ import {HostListener} from '../../src/metadata/directives';
})
class ParentCmp {
public exp: boolean = true;
@ViewChild('child', {static: false}) public childElm: any;
@ViewChild('child') public childElm: any;
public childEvent: any;
@ -2694,7 +2694,7 @@ import {HostListener} from '../../src/metadata/directives';
class ParentCmp {
public exp: any;
@ViewChild('child', {static: false}) public childCmp: any;
@ViewChild('child') public childCmp: any;
}
@Component({
@ -2758,7 +2758,7 @@ import {HostListener} from '../../src/metadata/directives';
`
})
class ParentCmp {
@ViewChild('child', {static: false}) public childCmp: any;
@ViewChild('child') public childCmp: any;
public exp: any;
public log: string[] = [];
@ -2936,7 +2936,7 @@ import {HostListener} from '../../src/metadata/directives';
class ParentCmp {
public exp: any;
@ViewChild('child', {static: false}) public childCmp: any;
@ViewChild('child') public childCmp: any;
}
@Component({
@ -3015,13 +3015,13 @@ import {HostListener} from '../../src/metadata/directives';
class ParentCmp {
public exp: any;
@ViewChild('child', {static: false}) public innerCmp: any;
@ViewChild('child') public innerCmp: any;
}
@Component(
{selector: 'child-cmp', template: '<grandchild-cmp #grandchild></grandchild-cmp>'})
class ChildCmp {
@ViewChild('grandchild', {static: false}) public innerCmp: any;
@ViewChild('grandchild') public innerCmp: any;
}
@Component({

View File

@ -165,7 +165,7 @@ import {TestBed} from '../../testing';
]
})
class Cmp {
@ViewChild('elm', {static: false}) public element: any;
@ViewChild('elm') public element: any;
public myAnimationExp = '';
}
@ -216,7 +216,7 @@ import {TestBed} from '../../testing';
]
})
class Cmp {
@ViewChild('elm', {static: false}) public element: any;
@ViewChild('elm') public element: any;
public myAnimationExp = '';
}