From 748c2d6c97d75a065d532eba516afe5db88997d8 Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Wed, 5 Aug 2015 16:35:59 +0200 Subject: [PATCH] fix(compiler): strip +
beforeinsideafter
` + })) + .createAsync(MyComp) + .then((rootTC) => { + expect(DOM.querySelectorAll(rootTC.nativeElement, 'script').length).toEqual(0); + async.done(); + }); + })); + }); + describe("error handling", () => { it('should report a meaningful error when a directive is missing annotation', inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => { diff --git a/modules/angular2/test/render/dom/compiler/compiler_common_tests.ts b/modules/angular2/test/render/dom/compiler/compiler_common_tests.ts index 82aca739b8..b24d97fe9c 100644 --- a/modules/angular2/test/render/dom/compiler/compiler_common_tests.ts +++ b/modules/angular2/test/render/dom/compiler/compiler_common_tests.ts @@ -131,6 +131,16 @@ export function runCompilerCommonTests() { }); })); + it('should remove script tags from templates', inject([AsyncTestCompleter], (async) => { + var compiler = createCompiler(EMPTY_STEP); + compiler.compile(new ViewDefinition( + {componentId: 'someId', template: '
'})) + .then((protoView) => { + expect(DOM.getInnerHTML(templateRoot(protoView))).toEqual('
'); + async.done(); + }); + })); + it('should report loading errors', inject([AsyncTestCompleter], (async) => { var compiler = createCompiler(EMPTY_STEP, null, new Map()); PromiseWrapper.catchError(