From d9ae70c699c4e2969f2d3539c50e719ba47bb6a1 Mon Sep 17 00:00:00 2001 From: Kara Erickson Date: Fri, 26 Jan 2018 15:00:54 -0800 Subject: [PATCH] test(ivy): normalize template names in canonical spec (#21815) PR Close #21815 --- .../core/test/render3/compiler_canonical_spec.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/core/test/render3/compiler_canonical_spec.ts b/packages/core/test/render3/compiler_canonical_spec.ts index 701b720bf0..5c93e2474a 100644 --- a/packages/core/test/render3/compiler_canonical_spec.ts +++ b/packages/core/test/render3/compiler_canonical_spec.ts @@ -686,7 +686,7 @@ describe('compiler specification', () => { @Component({selector: 'lifecycle-comp', template: ``}) class LifecycleComp { - @Input() nameMin: string; + @Input('name') nameMin: string; ngOnChanges() { events.push('changes' + this.nameMin); } @@ -701,14 +701,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] }); + // /NORMATIVE } @Component({ @@ -722,11 +724,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(); @@ -741,6 +744,7 @@ describe('compiler specification', () => { r3.r(3, 2); } }); + // /NORMATIVE } it('should gen hooks with a few simple components', () => {