@@ -65,6 +65,10 @@ describe('UpdateChanges', () => {
65
65
'test2.component.html' ,
66
66
'<igx-remove attr></igx-remove><igx-component>'
67
67
) ;
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
+ ) ;
68
72
69
73
const update = new UnitUpdateChanges ( __dirname , appTree ) ;
70
74
expect ( fs . existsSync ) . toHaveBeenCalledWith ( jsonPath ) ;
@@ -74,6 +78,9 @@ describe('UpdateChanges', () => {
74
78
update . applyChanges ( ) ;
75
79
expect ( appTree . readContent ( 'test.component.html' ) ) . toEqual ( '<igx-replaced> <content> </igx-replaced> ' ) ;
76
80
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
+ ) ;
77
84
done ( ) ;
78
85
} ) ;
79
86
@@ -175,7 +182,7 @@ describe('UpdateChanges', () => {
175
182
} ) ;
176
183
spyOn < any > ( fs , 'readFileSync' ) . and . callFake ( ( ) => JSON . stringify ( inputJson ) ) ;
177
184
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" />` ;
179
186
appTree . create ( 'test.component.html' , fileContent ) ;
180
187
181
188
const update = new UnitUpdateChanges ( __dirname , appTree ) ;
@@ -213,6 +220,15 @@ describe('UpdateChanges', () => {
213
220
update4 . applyChanges ( ) ;
214
221
expect ( appTree . readContent ( 'test.component.html' ) ) . toEqual (
215
222
`<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
+
216
232
done ( ) ;
217
233
} ) ;
218
234
0 commit comments