Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(compiler-cli): fix and re-enable compliance source-map tests (#4…
…0040) These tests started failing because they had type-check errors in their templates, and a recent commit turned on full template type-checking by default.\ This commit fixes those templates and updates the expected files as necessary. PR Close #40040
- Loading branch information
1 parent
42d478b
commit 85760cb
Showing
25 changed files
with
437 additions
and
75 deletions.
There are no files selected for viewing
432 changes: 374 additions & 58 deletions
432
...compiler-cli/test/compliance/test_cases/source_mapping/inline_templates/GOLDEN_PARTIAL.js
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...iance/test_cases/source_mapping/inline_templates/i18n_message_interpolation_whitespace.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...st_cases/source_mapping/inline_templates/i18n_message_interpolation_whitespace_partial.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...r-cli/test/compliance/test_cases/source_mapping/inline_templates/input_binding_complex.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
i0.ɵɵelement(0, "div", 0) // SOURCE: "/input_binding_complex.ts" <div | ||
… | ||
i0.ɵɵproperty("attr", ctx.greeting + ctx.name) // SOURCE: "/input_binding_complex.ts" [attr]="greeting + name" | ||
i0.ɵɵproperty("title", ctx.greeting + ctx.name) // SOURCE: "/input_binding_complex.ts" [title]="greeting + name" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...st/compliance/test_cases/source_mapping/inline_templates/input_binding_complex_partial.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.ɵɵelement(0, "div", 0) // SOURCE: "/input_binding_complex.ts" <div | ||
… | ||
// TODO: Work out how to fix the broken segment for the last item in a template | ||
.ɵɵproperty("attr", ctx.greeting // SOURCE: "/input_binding_complex.ts" [attr]="greeting + name"></div>' | ||
.ɵɵproperty("title", ctx.greeting // SOURCE: "/input_binding_complex.ts" [title]="greeting + name"></div>' |
2 changes: 1 addition & 1 deletion
2
...-cli/test/compliance/test_cases/source_mapping/inline_templates/input_binding_longhand.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
i0.ɵɵelement(0, "div", 0) // SOURCE: "/input_binding_longhand.ts" <div | ||
… | ||
i0.ɵɵproperty("attr", ctx.name) // SOURCE: "/input_binding_longhand.ts" bind-attr="name" | ||
i0.ɵɵproperty("title", ctx.name) // SOURCE: "/input_binding_longhand.ts" bind-title="name" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...t/compliance/test_cases/source_mapping/inline_templates/input_binding_longhand_partial.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.ɵɵelement(0, "div", 0) // SOURCE: "/input_binding_longhand.ts" <div | ||
… | ||
// TODO: Work out how to fix the broken segment for the last item in a template | ||
.ɵɵproperty("attr", ctx. // SOURCE: "/input_binding_longhand.ts" bind-attr="name"></div>' | ||
.ɵɵproperty("title", ctx. // SOURCE: "/input_binding_longhand.ts" bind-title="name"></div>' |
2 changes: 1 addition & 1 deletion
2
...er-cli/test/compliance/test_cases/source_mapping/inline_templates/input_binding_simple.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
i0.ɵɵelement(0, "div", 0) // SOURCE: "/input_binding_simple.ts" <div | ||
… | ||
i0.ɵɵproperty("attr", ctx.name) // SOURCE: "/input_binding_simple.ts" [attr]="name" | ||
i0.ɵɵproperty("title", ctx.name) // SOURCE: "/input_binding_simple.ts" [title]="name" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...est/compliance/test_cases/source_mapping/inline_templates/input_binding_simple_partial.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.ɵɵelement(0, "div", 0) // SOURCE: "/input_binding_simple.ts" <div | ||
… | ||
// TODO: Work out how to fix the broken segment for the last item in a template | ||
.ɵɵproperty("attr", c // SOURCE: "/input_binding_simple.ts" [attr]="name"></div>' | ||
.ɵɵproperty("title", c // SOURCE: "/input_binding_simple.ts" [title]="name"></div>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletion
11
...cli/test/compliance/test_cases/source_mapping/inline_templates/interpolation_with_pipe.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
import {Component} from '@angular/core'; | ||
import {Component, NgModule, Pipe, PipeTransform} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'test-cmp', | ||
template: '<div>{{200.3 | percent : 2 }}</div>', | ||
}) | ||
export class TestCmp { | ||
} | ||
|
||
@Pipe({name: 'percent'}) | ||
export class PercentPipe implements PipeTransform { | ||
transform() {} | ||
} | ||
|
||
@NgModule({declarations: [TestCmp, PercentPipe]}) | ||
export class AppModule { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 12 additions & 1 deletion
13
...li/test/compliance/test_cases/source_mapping/inline_templates/two_way_binding_longhand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
import {Component} from '@angular/core'; | ||
import {Component, Directive, EventEmitter, Input, NgModule, Output} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'test-cmp', | ||
template: 'Name: <input bindon-ngModel="name">', | ||
}) | ||
export class TestCmp { | ||
name: string = ''; | ||
} | ||
|
||
@Directive({selector: '[ngModel]'}) | ||
export class NgModelDirective { | ||
@Input() ngModel: string = ''; | ||
@Output() ngModelChanges: EventEmitter<string> = new EventEmitter(); | ||
} | ||
|
||
@NgModule({declarations: [TestCmp, NgModelDirective]}) | ||
export class AppModule { | ||
} |
13 changes: 12 additions & 1 deletion
13
...-cli/test/compliance/test_cases/source_mapping/inline_templates/two_way_binding_simple.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
import {Component} from '@angular/core'; | ||
import {Component, Directive, EventEmitter, Input, NgModule, Output} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'test-cmp', | ||
template: 'Name: <input [(ngModel)]="name">', | ||
}) | ||
export class TestCmp { | ||
name: string = ''; | ||
} | ||
|
||
@Directive({selector: '[ngModel]'}) | ||
export class NgModelDirective { | ||
@Input() ngModel: string = ''; | ||
@Output() ngModelChanges: EventEmitter<string> = new EventEmitter(); | ||
} | ||
|
||
@NgModule({declarations: [TestCmp, NgModelDirective]}) | ||
export class AppModule { | ||
} |