From 76e3b57a123fcf429984faba77a80c467d4d183a Mon Sep 17 00:00:00 2001 From: Andrew Kushnir Date: Tue, 9 Jul 2019 18:08:33 -0700 Subject: [PATCH] test(ivy): verify no translations are generated for bound attributes (#31481) This commit adds a test that verifies no translations are generated for bound attributes and also checks (as a part of the `verify` function) that VE and Ivy handle this case the same way. PR Close #31481 --- .../compliance/r3_view_compiler_i18n_spec.ts | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/packages/compiler-cli/test/compliance/r3_view_compiler_i18n_spec.ts b/packages/compiler-cli/test/compliance/r3_view_compiler_i18n_spec.ts index c8fb19cfb3..12a2b94a57 100644 --- a/packages/compiler-cli/test/compliance/r3_view_compiler_i18n_spec.ts +++ b/packages/compiler-cli/test/compliance/r3_view_compiler_i18n_spec.ts @@ -324,6 +324,31 @@ describe('i18n support in the view compiler', () => { verify(input, output); }); + it('should not create translations for bound attributes', () => { + const input = ` +
+
+ `; + + const output = ` + const $_c0$ = [${AttributeMarker.Bindings}, "title", "label"]; + … + template: function MyComponent_Template(rf, ctx) { + if (rf & 1) { + $r3$.ɵɵelement(0, "div", $_c0$); + } + if (rf & 2) { + $r3$.ɵɵproperty("title", ctx.title); + $r3$.ɵɵattribute("label", ctx.label); + } + } + `; + + verify(input, output); + }); + it('should translate static attributes', () => { const input = `