test(language-service): Inline test cases in parsing-cases.ts (#36495)
This commit removes individual components from parsing-cases.ts and colocate them with the actual tests. This makes the tests more readable. PR Close #36495
This commit is contained in:

committed by
Kara Erickson

parent
41667de778
commit
e485236502
@ -63,45 +63,6 @@ export class HintModel {
|
||||
hintChange: EventEmitter<string> = new EventEmitter();
|
||||
}
|
||||
|
||||
interface Person {
|
||||
name: string;
|
||||
age: number;
|
||||
street: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
<div *ngFor="let person of people | async">
|
||||
{{person.~{async-person-name}name}}
|
||||
</div>
|
||||
<div *ngIf="promisedPerson | async as person">
|
||||
{{person.~{promised-person-name}name}}
|
||||
</div>
|
||||
`,
|
||||
})
|
||||
export class AsyncForUsingComponent {
|
||||
people: Promise<Person[]> = Promise.resolve([]);
|
||||
promisedPerson: Promise<Person> = Promise.resolve({
|
||||
name: 'John Doe',
|
||||
age: 42,
|
||||
street: '123 Angular Ln',
|
||||
});
|
||||
}
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
<div #div>
|
||||
<test-comp #test1>
|
||||
{{~{test-comp-content}}}
|
||||
{{test1.~{test-comp-after-test}name}}
|
||||
{{div.~{test-comp-after-div}.innerText}}
|
||||
</test-comp>
|
||||
</div>
|
||||
<test-comp #test2></test-comp>`,
|
||||
})
|
||||
export class References {
|
||||
}
|
||||
|
||||
class CounterDirectiveContext<T> {
|
||||
constructor(public $implicit: T) {}
|
||||
}
|
||||
@ -121,8 +82,8 @@ export class CounterDirective implements OnChanges {
|
||||
}
|
||||
|
||||
interface WithContextDirectiveContext {
|
||||
$implicit: {implicitPerson: Person;};
|
||||
nonImplicitPerson: Person;
|
||||
$implicit: {implicitPerson: Hero;};
|
||||
nonImplicitPerson: Hero;
|
||||
}
|
||||
|
||||
@Directive({selector: '[withContext]'})
|
||||
@ -156,7 +117,9 @@ export class TemplateReference {
|
||||
*/
|
||||
title = 'Some title';
|
||||
hero: Hero = {id: 1, name: 'Windstorm'};
|
||||
heroP = Promise.resolve(this.hero);
|
||||
heroes: Hero[] = [this.hero];
|
||||
heroesP = Promise.resolve(this.heroes);
|
||||
tupleArray: [string, Hero] = ['test', this.hero];
|
||||
league: Hero[][] = [this.heroes];
|
||||
heroesByName: {[name: string]: Hero} = {};
|
||||
@ -171,11 +134,3 @@ export class TemplateReference {
|
||||
constNames = [{name: 'name'}] as const;
|
||||
private myField = 'My Field';
|
||||
}
|
||||
|
||||
@Component({
|
||||
template: '{{~{empty-interpolation}}}',
|
||||
})
|
||||
export class EmptyInterpolation {
|
||||
title = 'Some title';
|
||||
subTitle = 'Some sub title';
|
||||
}
|
||||
|
Reference in New Issue
Block a user