Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(ivy): normalize template names in canonical spec #21815

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 9 additions & 5 deletions packages/core/test/render3/compiler_canonical_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ describe('compiler specification', () => {

@Component({selector: 'lifecycle-comp', template: ``})
class LifecycleComp {
@Input() nameMin: string;
@Input('name') nameMin: string;

ngOnChanges() { events.push('changes' + this.nameMin); }

Expand All @@ -291,14 +291,16 @@ describe('compiler specification', () => {

ngOnDestroy() { events.push(this.nameMin); }

// NORMATIVE
static ngComponentDef = r3.defineComponent({
type: LifecycleComp,
tag: 'lifecycle-comp',
factory: () => new LifecycleComp(),
template: function(ctx: any, cm: boolean) {},
factory: function LifecycleComp_Factory() { return new LifecycleComp(); },
template: function LifecycleComp_Template(ctx: LifecycleComp, cm: boolean) {},
inputs: {nameMin: 'name'},
features: [r3.NgOnChangesFeature(LifecycleComp)]
});
// /NORMATIVE
}

@Component({
Expand All @@ -312,11 +314,12 @@ describe('compiler specification', () => {
name1 = '1';
name2 = '2';

// NORMATIVE
static ngComponentDef = r3.defineComponent({
type: SimpleLayout,
tag: 'simple-layout',
factory: () => simpleLayout = new SimpleLayout(),
template: function(ctx: any, cm: boolean) {
factory: function SimpleLayout_Factory() { return simpleLayout = new SimpleLayout(); },
template: function SimpleLayout_Template(ctx: SimpleLayout, cm: boolean) {
if (cm) {
r3.E(0, LifecycleComp);
r3.e();
Expand All @@ -331,6 +334,7 @@ describe('compiler specification', () => {
r3.r(3, 2);
}
});
// /NORMATIVE
}

it('should gen hooks with a few simple components', () => {
Expand Down