@@ -65,6 +65,10 @@ describe('UpdateChanges', () => {
6565 'test2.component.html' ,
6666 '<igx-remove attr></igx-remove><igx-component>'
6767 ) ;
68+ appTree . create (
69+ 'test3.component.html' ,
70+ '<igx-remove-me-not attr></igx-remove-me-not> <igx-component> <igx-component-child></igx-component-child> </igx-component>'
71+ ) ;
6872
6973 const update = new UnitUpdateChanges ( __dirname , appTree ) ;
7074 expect ( fs . existsSync ) . toHaveBeenCalledWith ( jsonPath ) ;
@@ -74,6 +78,9 @@ describe('UpdateChanges', () => {
7478 update . applyChanges ( ) ;
7579 expect ( appTree . readContent ( 'test.component.html' ) ) . toEqual ( '<igx-replaced> <content> </igx-replaced> ' ) ;
7680 expect ( appTree . readContent ( 'test2.component.html' ) ) . toEqual ( '<igx-replaced>' ) ;
81+ expect ( appTree . readContent ( 'test3.component.html' ) ) . toEqual (
82+ '<igx-remove-me-not attr></igx-remove-me-not> <igx-replaced> <igx-component-child></igx-component-child> </igx-replaced>'
83+ ) ;
7784 done ( ) ;
7885 } ) ;
7986
@@ -175,7 +182,7 @@ describe('UpdateChanges', () => {
175182 } ) ;
176183 spyOn < any > ( fs , 'readFileSync' ) . and . callFake ( ( ) => JSON . stringify ( inputJson ) ) ;
177184
178- const fileContent = `<one [replaceMe]="a"> <comp\r\ntag [replaceMe]="dwdw" [oldProp]=''> </other> <another oldProp="b" />` ;
185+ let fileContent = `<one [replaceMe]="a"> <comp\r\ntag [replaceMe]="dwdw" [oldProp]=''> </other> <another oldProp="b" />` ;
179186 appTree . create ( 'test.component.html' , fileContent ) ;
180187
181188 const update = new UnitUpdateChanges ( __dirname , appTree ) ;
@@ -213,6 +220,15 @@ describe('UpdateChanges', () => {
213220 update4 . applyChanges ( ) ;
214221 expect ( appTree . readContent ( 'test.component.html' ) ) . toEqual (
215222 `<comp\r\ntag [oldProp]="g" [replaced]="NOT.replaceMe" ><another [otherProp]="oldProp" /></comp>` ) ;
223+
224+
225+ fileContent = `<span [bait]="replaceMe"><ng-container ngProjectAs="comp"> sike! </ng-container></span>` ;
226+ appTree . overwrite ( 'test.component.html' , fileContent ) ;
227+ update4 . applyChanges ( ) ;
228+ expect ( appTree . readContent ( 'test.component.html' ) ) . toEqual (
229+ `<span [bait]="replaceMe"><ng-container ngProjectAs="comp"> sike! </ng-container></span>`
230+ ) ;
231+
216232 done ( ) ;
217233 } ) ;
218234
0 commit comments