@ihk-gfi/lux-components-update 14.8.0 → 15.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/README.md +4 -2
  2. package/add-lux-components/files/app/app.component.html +34 -0
  3. package/{src/add-lux-components → add-lux-components}/files/app/app.component.spec.ts +4 -2
  4. package/{src/add-lux-components → add-lux-components}/files/app/app.component.ts +1 -1
  5. package/add-lux-components/files/src/main.ts +17 -0
  6. package/{src/add-lux-components → add-lux-components}/index.js +29 -30
  7. package/add-lux-components/schema.json +23 -0
  8. package/collection.json +35 -0
  9. package/package.json +27 -27
  10. package/{src/theme → theme}/change-theme-to-authentic/index.js +0 -1
  11. package/theme/change-theme-to-authentic/schema.json +23 -0
  12. package/{src/theme → theme}/change-to-lux-icons/index.js +0 -1
  13. package/theme/change-to-lux-icons/schema.json +23 -0
  14. package/{src/update-dependencies → update-dependencies}/index.d.ts +1 -0
  15. package/update-dependencies/index.js +92 -0
  16. package/update-dependencies/schema.json +23 -0
  17. package/{src/update-en-messages → update-en-messages}/index.js +0 -1
  18. package/update-en-messages/schema.json +23 -0
  19. package/updates/15.0.0/index.d.ts +8 -0
  20. package/updates/15.0.0/index.js +109 -0
  21. package/updates/15.0.0/schema.json +23 -0
  22. package/{src/utility → utility}/dependencies.js +0 -1
  23. package/{src/utility → utility}/files.js +0 -1
  24. package/{src/utility → utility}/html/hit.js +0 -1
  25. package/{src/utility → utility}/html/html-manipulator.js +0 -1
  26. package/{src/utility → utility}/html/manipulator-functions.js +0 -1
  27. package/{src/utility → utility}/json.d.ts +2 -0
  28. package/{src/utility → utility}/json.js +16 -8
  29. package/{src/utility → utility}/logging.js +0 -1
  30. package/{src/utility → utility}/test.js +0 -1
  31. package/{src/utility → utility}/typescript.js +0 -1
  32. package/{src/utility → utility}/util.js +0 -1
  33. package/{src/utility → utility}/validation.js +0 -1
  34. package/src/add-lux-components/files/app/app.component.html +0 -32
  35. package/src/add-lux-components/files/app/base/license-hint/license-hint.component.html +0 -7
  36. package/src/add-lux-components/files/app/base/license-hint/license-hint.component.ts +0 -18
  37. package/src/add-lux-components/files/app/error/error.component.html +0 -10
  38. package/src/add-lux-components/files/app/error/error.component.scss +0 -3
  39. package/src/add-lux-components/files/app/error/error.component.spec.ts +0 -49
  40. package/src/add-lux-components/files/app/error/error.component.ts +0 -17
  41. package/src/add-lux-components/files/app/home/home.component.html +0 -7
  42. package/src/add-lux-components/files/app/home/home.component.scss +0 -3
  43. package/src/add-lux-components/files/app/home/home.component.ts +0 -13
  44. package/src/add-lux-components/files/app/profil/profil.component.html +0 -1
  45. package/src/add-lux-components/files/app/profil/profil.component.scss +0 -0
  46. package/src/add-lux-components/files/app/profil/profil.component.spec.ts +0 -24
  47. package/src/add-lux-components/files/app/profil/profil.component.ts +0 -11
  48. package/src/add-lux-components/files/assets/svg/Example.svg +0 -6
  49. package/src/add-lux-components/files/assets/svg/android.svg +0 -2
  50. package/src/add-lux-components/files/assets/svg/box.svg +0 -690
  51. package/src/add-lux-components/files/assets/svg/demoAppLogo.svg +0 -1
  52. package/src/add-lux-components/files/assets/svg/red_power_button.svg +0 -67
  53. package/src/add-lux-components/files/assets/svg/svg2009.svg +0 -57457
  54. package/src/add-lux-components/files/src/polyfills.ts +0 -58
  55. package/src/add-lux-components/index.js.map +0 -1
  56. package/src/add-lux-components/index.ts +0 -293
  57. package/src/add-lux-components/index_spec.d.ts +0 -1
  58. package/src/add-lux-components/index_spec.js +0 -51
  59. package/src/add-lux-components/index_spec.js.map +0 -1
  60. package/src/add-lux-components/index_spec.ts +0 -55
  61. package/src/add-lux-components/schema.json +0 -23
  62. package/src/collection.json +0 -75
  63. package/src/theme/change-theme-to-authentic/index.js.map +0 -1
  64. package/src/theme/change-theme-to-authentic/index.ts +0 -131
  65. package/src/theme/change-theme-to-authentic/index_spec.d.ts +0 -1
  66. package/src/theme/change-theme-to-authentic/index_spec.js +0 -300
  67. package/src/theme/change-theme-to-authentic/index_spec.js.map +0 -1
  68. package/src/theme/change-theme-to-authentic/index_spec.ts +0 -321
  69. package/src/theme/change-theme-to-authentic/schema.json +0 -23
  70. package/src/theme/change-to-lux-icons/index.js.map +0 -1
  71. package/src/theme/change-to-lux-icons/index.ts +0 -392
  72. package/src/theme/change-to-lux-icons/index_spec.d.ts +0 -1
  73. package/src/theme/change-to-lux-icons/index_spec.js +0 -128
  74. package/src/theme/change-to-lux-icons/index_spec.js.map +0 -1
  75. package/src/theme/change-to-lux-icons/index_spec.ts +0 -130
  76. package/src/theme/change-to-lux-icons/schema.json +0 -23
  77. package/src/update-dependencies/index.js +0 -88
  78. package/src/update-dependencies/index.js.map +0 -1
  79. package/src/update-dependencies/index.ts +0 -86
  80. package/src/update-dependencies/schema.json +0 -23
  81. package/src/update-en-messages/index.js.map +0 -1
  82. package/src/update-en-messages/index.ts +0 -83
  83. package/src/update-en-messages/index_spec.d.ts +0 -1
  84. package/src/update-en-messages/index_spec.js +0 -174
  85. package/src/update-en-messages/index_spec.js.map +0 -1
  86. package/src/update-en-messages/index_spec.ts +0 -182
  87. package/src/update-en-messages/schema.json +0 -23
  88. package/src/updates/update140000/files/src/polyfills.ts +0 -70
  89. package/src/updates/update140000/index.d.ts +0 -14
  90. package/src/updates/update140000/index.js +0 -95
  91. package/src/updates/update140000/index.js.map +0 -1
  92. package/src/updates/update140000/index.ts +0 -110
  93. package/src/updates/update140000/index_spec.d.ts +0 -1
  94. package/src/updates/update140000/index_spec.js +0 -165
  95. package/src/updates/update140000/index_spec.js.map +0 -1
  96. package/src/updates/update140000/index_spec.ts +0 -171
  97. package/src/updates/update140000/schema.json +0 -23
  98. package/src/updates/update140100/index.d.ts +0 -5
  99. package/src/updates/update140100/index.js +0 -62
  100. package/src/updates/update140100/index.js.map +0 -1
  101. package/src/updates/update140100/index.ts +0 -60
  102. package/src/updates/update140100/index_spec.d.ts +0 -1
  103. package/src/updates/update140100/index_spec.js +0 -124
  104. package/src/updates/update140100/index_spec.js.map +0 -1
  105. package/src/updates/update140100/index_spec.ts +0 -137
  106. package/src/updates/update140100/schema.json +0 -23
  107. package/src/updates/update140200/index.d.ts +0 -8
  108. package/src/updates/update140200/index.js +0 -40
  109. package/src/updates/update140200/index.js.map +0 -1
  110. package/src/updates/update140200/index.ts +0 -38
  111. package/src/updates/update140200/index_spec.d.ts +0 -1
  112. package/src/updates/update140200/index_spec.js +0 -75
  113. package/src/updates/update140200/index_spec.js.map +0 -1
  114. package/src/updates/update140200/index_spec.ts +0 -81
  115. package/src/updates/update140200/schema.json +0 -23
  116. package/src/updates/update140300/index.d.ts +0 -10
  117. package/src/updates/update140300/index.js +0 -85
  118. package/src/updates/update140300/index.js.map +0 -1
  119. package/src/updates/update140300/index.ts +0 -86
  120. package/src/updates/update140300/index_spec.d.ts +0 -1
  121. package/src/updates/update140300/index_spec.js +0 -145
  122. package/src/updates/update140300/index_spec.js.map +0 -1
  123. package/src/updates/update140300/index_spec.ts +0 -177
  124. package/src/updates/update140300/schema.json +0 -23
  125. package/src/updates/update140400/index.d.ts +0 -2
  126. package/src/updates/update140400/index.js +0 -22
  127. package/src/updates/update140400/index.js.map +0 -1
  128. package/src/updates/update140400/index.ts +0 -18
  129. package/src/updates/update140400/index_spec.d.ts +0 -1
  130. package/src/updates/update140400/index_spec.js +0 -75
  131. package/src/updates/update140400/index_spec.js.map +0 -1
  132. package/src/updates/update140400/index_spec.ts +0 -81
  133. package/src/updates/update140400/schema.json +0 -23
  134. package/src/updates/update140500/index.d.ts +0 -2
  135. package/src/updates/update140500/index.js +0 -21
  136. package/src/updates/update140500/index.js.map +0 -1
  137. package/src/updates/update140500/index.ts +0 -17
  138. package/src/updates/update140500/index_spec.d.ts +0 -1
  139. package/src/updates/update140500/index_spec.js +0 -73
  140. package/src/updates/update140500/index_spec.js.map +0 -1
  141. package/src/updates/update140500/index_spec.ts +0 -78
  142. package/src/updates/update140500/schema.json +0 -23
  143. package/src/updates/update140600/index.d.ts +0 -2
  144. package/src/updates/update140600/index.js +0 -39
  145. package/src/updates/update140600/index.js.map +0 -1
  146. package/src/updates/update140600/index.ts +0 -35
  147. package/src/updates/update140600/index_spec.d.ts +0 -1
  148. package/src/updates/update140600/index_spec.js +0 -71
  149. package/src/updates/update140600/index_spec.js.map +0 -1
  150. package/src/updates/update140600/index_spec.ts +0 -75
  151. package/src/updates/update140600/schema.json +0 -23
  152. package/src/updates/update140700/index.d.ts +0 -2
  153. package/src/updates/update140700/index.js +0 -22
  154. package/src/updates/update140700/index.js.map +0 -1
  155. package/src/updates/update140700/index.ts +0 -18
  156. package/src/updates/update140700/index_spec.d.ts +0 -1
  157. package/src/updates/update140700/index_spec.js +0 -75
  158. package/src/updates/update140700/index_spec.js.map +0 -1
  159. package/src/updates/update140700/index_spec.ts +0 -79
  160. package/src/updates/update140700/schema.json +0 -23
  161. package/src/updates/update140800/index.d.ts +0 -2
  162. package/src/updates/update140800/index.js +0 -22
  163. package/src/updates/update140800/index.js.map +0 -1
  164. package/src/updates/update140800/index.ts +0 -18
  165. package/src/updates/update140800/index_spec.d.ts +0 -1
  166. package/src/updates/update140800/index_spec.js +0 -76
  167. package/src/updates/update140800/index_spec.js.map +0 -1
  168. package/src/updates/update140800/index_spec.ts +0 -82
  169. package/src/updates/update140800/schema.json +0 -23
  170. package/src/utility/dependencies.js.map +0 -1
  171. package/src/utility/dependencies.ts +0 -144
  172. package/src/utility/files.js.map +0 -1
  173. package/src/utility/files.ts +0 -368
  174. package/src/utility/html/hit.js.map +0 -1
  175. package/src/utility/html/hit.ts +0 -28
  176. package/src/utility/html/html-manipulator.js.map +0 -1
  177. package/src/utility/html/html-manipulator.ts +0 -156
  178. package/src/utility/html/html_spec.d.ts +0 -1
  179. package/src/utility/html/html_spec.js +0 -692
  180. package/src/utility/html/html_spec.js.map +0 -1
  181. package/src/utility/html/html_spec.ts +0 -751
  182. package/src/utility/html/manipulator-functions.js.map +0 -1
  183. package/src/utility/html/manipulator-functions.ts +0 -149
  184. package/src/utility/json.js.map +0 -1
  185. package/src/utility/json.ts +0 -288
  186. package/src/utility/json_spec.d.ts +0 -1
  187. package/src/utility/json_spec.js +0 -326
  188. package/src/utility/json_spec.js.map +0 -1
  189. package/src/utility/json_spec.ts +0 -446
  190. package/src/utility/logging.js.map +0 -1
  191. package/src/utility/logging.ts +0 -80
  192. package/src/utility/test.js.map +0 -1
  193. package/src/utility/test.ts +0 -24
  194. package/src/utility/typescript.js.map +0 -1
  195. package/src/utility/typescript.ts +0 -598
  196. package/src/utility/typescript_spec.d.ts +0 -1
  197. package/src/utility/typescript_spec.js +0 -1005
  198. package/src/utility/typescript_spec.js.map +0 -1
  199. package/src/utility/typescript_spec.ts +0 -1265
  200. package/src/utility/util.js.map +0 -1
  201. package/src/utility/util.ts +0 -145
  202. package/src/utility/validation.js.map +0 -1
  203. package/src/utility/validation.ts +0 -48
  204. package/tsconfig.json +0 -35
  205. /package/{src/add-lux-components → add-lux-components}/files/app/app-routing.module.ts +0 -0
  206. /package/{src/add-lux-components → add-lux-components}/files/app/app.module.ts +0 -0
  207. /package/{src/add-lux-components → add-lux-components}/files/environments/environment.prod.ts +0 -0
  208. /package/{src/add-lux-components → add-lux-components}/files/environments/environment.ts +0 -0
  209. /package/{src/add-lux-components → add-lux-components}/files/locale/messages.en.xlf +0 -0
  210. /package/{src/add-lux-components → add-lux-components}/files/locale/messages.xlf +0 -0
  211. /package/{src/add-lux-components → add-lux-components}/files/src/index.html +0 -0
  212. /package/{src/add-lux-components → add-lux-components}/index.d.ts +0 -0
  213. /package/{src/theme → theme}/change-theme-to-authentic/index.d.ts +0 -0
  214. /package/{src/theme → theme}/change-to-lux-icons/index.d.ts +0 -0
  215. /package/{src/update-en-messages → update-en-messages}/index.d.ts +0 -0
  216. /package/{src/utility → utility}/dependencies.d.ts +0 -0
  217. /package/{src/utility → utility}/files.d.ts +0 -0
  218. /package/{src/utility → utility}/html/hit.d.ts +0 -0
  219. /package/{src/utility → utility}/html/html-manipulator.d.ts +0 -0
  220. /package/{src/utility → utility}/html/manipulator-functions.d.ts +0 -0
  221. /package/{src/utility → utility}/logging.d.ts +0 -0
  222. /package/{src/utility → utility}/test.d.ts +0 -0
  223. /package/{src/utility → utility}/typescript.d.ts +0 -0
  224. /package/{src/utility → utility}/util.d.ts +0 -0
  225. /package/{src/utility → utility}/validation.d.ts +0 -0
@@ -1,1265 +0,0 @@
1
- import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
2
- import * as path from 'path';
3
- import { appOptions, workspaceOptions } from '../utility/test';
4
- import { UtilConfig } from '../utility/util';
5
- import {
6
- addClassProperty,
7
- addConstructorContent,
8
- addImport,
9
- addInterface,
10
- removeImport,
11
- removeInterface,
12
- removeProvider
13
- } from './typescript';
14
-
15
- const collectionPath = path.join(__dirname, '../collection.json');
16
-
17
- describe('typescript', () => {
18
- let appTree: UnitTestTree;
19
- let runner: SchematicTestRunner;
20
-
21
- const testOptions: any = {};
22
-
23
- beforeEach(async () => {
24
- runner = new SchematicTestRunner('schematics', collectionPath);
25
-
26
- appTree = await runner.runExternalSchematicAsync('@schematics/angular', 'workspace', workspaceOptions).toPromise();
27
- appTree = await runner
28
- .runExternalSchematicAsync('@schematics/angular', 'application', appOptions, appTree)
29
- .toPromise();
30
-
31
- UtilConfig.defaultWaitMS = 0;
32
-
33
- testOptions.project = appOptions.name;
34
- testOptions.path = workspaceOptions.newProjectRoot + '/' + appOptions.name;
35
- testOptions.verbose = true;
36
- });
37
-
38
- describe('[Method] removeProvider', () => {
39
- it('Sollte den Provider (mehrere Provider - erster Provider) entfernen', (done) => {
40
- const filePath = testOptions.path + '/src/app/test.component.ts';
41
-
42
- appTree.create(
43
- filePath,
44
- `
45
- import { environment } from '../environments/environment';
46
-
47
- @NgModule({
48
- declarations : [
49
- AppComponent
50
- ],
51
- imports : [
52
- HttpClientModule,
53
- ],
54
- entryComponents: [
55
- LuxFilePreviewComponent
56
- ],
57
- providers : [
58
- LuxStorageService,
59
- LuxDialogService,
60
- DatePipe
61
- ],
62
- bootstrap : [
63
- AppComponent
64
- ]
65
- })
66
- export class AppModule {
67
- }
68
-
69
- `
70
- );
71
-
72
- removeProvider(appTree, filePath, 'LuxStorageService', false);
73
-
74
- const content = appTree.read(filePath)?.toString();
75
- expect(content).toContain('providers : [\n LuxDialogService,\n DatePipe\n ],');
76
-
77
- done();
78
- });
79
-
80
- it('Sollte den Provider (mehrere Provider - mittlerer Provider) entfernen', (done) => {
81
- const filePath = testOptions.path + '/src/app/test.component.ts';
82
-
83
- appTree.create(
84
- filePath,
85
- `
86
- import { environment } from '../environments/environment';
87
-
88
- @NgModule({
89
- declarations : [
90
- AppComponent
91
- ],
92
- imports : [
93
- HttpClientModule,
94
- ],
95
- entryComponents: [
96
- LuxFilePreviewComponent
97
- ],
98
- providers : [
99
- LuxDialogService,
100
- LuxStorageService,
101
- DatePipe
102
- ],
103
- bootstrap : [
104
- AppComponent
105
- ]
106
- })
107
- export class AppModule {
108
- }
109
-
110
- `
111
- );
112
-
113
- removeProvider(appTree, filePath, 'LuxStorageService', false);
114
-
115
- const content = appTree.read(filePath)?.toString();
116
- expect(content).toContain('providers : [\n LuxDialogService,\n DatePipe\n ],');
117
-
118
- done();
119
- });
120
-
121
- it('Sollte den Provider (mehrere Provider - mittlerer Provider - komplexer Provider) entfernen', (done) => {
122
- const filePath = testOptions.path + '/src/app/test.component.ts';
123
-
124
- appTree.create(
125
- filePath,
126
- `
127
- import { environment } from '../environments/environment';
128
-
129
- @NgModule({
130
- declarations : [
131
- AppComponent
132
- ],
133
- imports : [
134
- HttpClientModule,
135
- ],
136
- entryComponents: [
137
- LuxFilePreviewComponent
138
- ],
139
- providers : [
140
- LuxDialogService,
141
- {
142
- provide : HTTP_INTERCEPTORS,
143
- useClass: UnauthorizedInterceptor,
144
- multi : true
145
- },
146
- DatePipe
147
- ],
148
- bootstrap : [
149
- AppComponent
150
- ]
151
- })
152
- export class AppModule {
153
- }
154
-
155
- `
156
- );
157
-
158
- removeProvider(appTree, filePath, 'HTTP_INTERCEPTORS', false);
159
-
160
- const content = appTree.read(filePath)?.toString();
161
- expect(content).toContain('providers : [\n LuxDialogService,\n DatePipe\n ],');
162
-
163
- done();
164
- });
165
-
166
- it('Sollte den Provider (mehrere Provider - letzter Provider) entfernen', (done) => {
167
- const filePath = testOptions.path + '/src/app/test.component.ts';
168
-
169
- appTree.create(
170
- filePath,
171
- `
172
- import { environment } from '../environments/environment';
173
-
174
- @NgModule({
175
- declarations : [
176
- AppComponent
177
- ],
178
- imports : [
179
- HttpClientModule,
180
- ],
181
- entryComponents: [
182
- LuxFilePreviewComponent
183
- ],
184
- providers : [
185
- LuxDialogService,
186
- DatePipe,
187
- LuxStorageService
188
- ],
189
- bootstrap : [
190
- AppComponent
191
- ]
192
- })
193
- export class AppModule {
194
- }
195
-
196
- `
197
- );
198
-
199
- removeProvider(appTree, filePath, 'LuxStorageService', false);
200
-
201
- const content = appTree.read(filePath)?.toString();
202
- expect(content).toContain('providers : [\n LuxDialogService,\n DatePipe\n ],');
203
-
204
- done();
205
- });
206
-
207
- it('Sollte den Provider (nicht vorhanden) entfernen', (done) => {
208
- const filePath = testOptions.path + '/src/app/test.component.ts';
209
-
210
- appTree.create(
211
- filePath,
212
- `
213
- import { environment } from '../environments/environment';
214
-
215
- @NgModule({
216
- declarations : [
217
- AppComponent
218
- ],
219
- imports : [
220
- HttpClientModule,
221
- ],
222
- entryComponents: [
223
- LuxFilePreviewComponent
224
- ],
225
- providers : [
226
- LuxDialogService,
227
- DatePipe
228
- ],
229
- bootstrap : [
230
- AppComponent
231
- ]
232
- })
233
- export class AppModule {
234
- }
235
-
236
- `
237
- );
238
-
239
- removeProvider(appTree, filePath, 'LuxStorageService', false);
240
-
241
- const content = appTree.read(filePath)?.toString();
242
- expect(content).toContain('providers : [\n LuxDialogService,\n DatePipe\n ],');
243
-
244
- done();
245
- });
246
-
247
- it('Sollte den Provider (Provider-Abschnitt fehlt vollständig) entfernen', (done) => {
248
- const filePath = testOptions.path + '/src/app/test.component.ts';
249
-
250
- appTree.create(
251
- filePath,
252
- `
253
- import { environment } from '../environments/environment';
254
-
255
- @NgModule({
256
- declarations : [
257
- AppComponent
258
- ],
259
- imports : [
260
- HttpClientModule,
261
- ],
262
- entryComponents: [
263
- LuxFilePreviewComponent
264
- ],
265
- bootstrap : [
266
- AppComponent
267
- ]
268
- })
269
- export class AppModule {
270
- }
271
-
272
- `
273
- );
274
-
275
- removeProvider(appTree, filePath, 'LuxStorageService', false);
276
-
277
- const content = appTree.read(filePath)?.toString();
278
- expect(content).not.toContain('providers');
279
-
280
- done();
281
- });
282
-
283
- });
284
-
285
- describe('[Method] removeInterface', () => {
286
- it('Sollte das Interface (mehrere Interfaces - erstes Interface) entfernen', (done) => {
287
- const filePath = testOptions.path + '/src/app/test.component.ts';
288
-
289
- appTree.create(
290
- filePath,
291
- `
292
- import { OnInit, OnDestroy, Component } from '@angular/core';
293
-
294
- @Component({
295
- selector : 'bp-anbindung-lazy',
296
- templateUrl: './anbindung-lazy.component.html'
297
- })
298
- export class AnbindungLazyComponent implements OnInit, OnDestroy {
299
-
300
- constructor() {
301
- }
302
-
303
- ngOnInit() {
304
- }
305
-
306
- }
307
-
308
- `
309
- );
310
-
311
- removeInterface(appTree, filePath, 'OnInit', false);
312
-
313
- const content = appTree.read(filePath)?.toString();
314
- expect(content).toContain("export class AnbindungLazyComponent implements OnDestroy {");
315
-
316
- done();
317
- });
318
-
319
- it('Sollte das Interface (mehrere Interfaces - mittleres Interface) entfernen', (done) => {
320
- const filePath = testOptions.path + '/src/app/test.component.ts';
321
-
322
- appTree.create(
323
- filePath,
324
- `
325
- import { OnChanges, OnInit, OnDestroy, Component } from '@angular/core';
326
-
327
- @Component({
328
- selector : 'bp-anbindung-lazy',
329
- templateUrl: './anbindung-lazy.component.html'
330
- })
331
- export class AnbindungLazyComponent implements OnChanges, OnInit, OnDestroy {
332
-
333
- constructor() {
334
- }
335
-
336
- ngOnInit() {
337
- }
338
-
339
- }
340
-
341
- `
342
- );
343
-
344
- removeInterface(appTree, filePath, 'OnInit', false);
345
-
346
- const content = appTree.read(filePath)?.toString();
347
- expect(content).toContain("export class AnbindungLazyComponent implements OnChanges, OnDestroy {");
348
-
349
- done();
350
- });
351
-
352
- it('Sollte das Interface (mehrere Interfaces - mittleres Interface - mit extends) entfernen', (done) => {
353
- const filePath = testOptions.path + '/src/app/test.component.ts';
354
-
355
- appTree.create(
356
- filePath,
357
- `
358
- import { OnChanges, OnInit, OnDestroy, Component } from '@angular/core';
359
-
360
- @Component({
361
- selector : 'bp-anbindung-lazy',
362
- templateUrl: './anbindung-lazy.component.html'
363
- })
364
- export class AnbindungLazyComponent extends Aaa implements OnChanges, OnInit, OnDestroy {
365
-
366
- constructor() {
367
- }
368
-
369
- ngOnInit() {
370
- }
371
-
372
- }
373
-
374
- `
375
- );
376
-
377
- removeInterface(appTree, filePath, 'OnInit', false);
378
-
379
- const content = appTree.read(filePath)?.toString();
380
- expect(content).toContain("export class AnbindungLazyComponent extends Aaa implements OnChanges, OnDestroy {");
381
-
382
- done();
383
- });
384
-
385
- it('Sollte das Interface (mehrere Interfaces - letztes Interface) entfernen', (done) => {
386
- const filePath = testOptions.path + '/src/app/test.component.ts';
387
-
388
- appTree.create(
389
- filePath,
390
- `
391
- import { OnChanges, OnInit, OnDestroy, Component } from '@angular/core';
392
-
393
- @Component({
394
- selector : 'bp-anbindung-lazy',
395
- templateUrl: './anbindung-lazy.component.html'
396
- })
397
- export class AnbindungLazyComponent implements OnChanges, OnDestroy, OnInit {
398
-
399
- constructor() {
400
- }
401
-
402
- ngOnInit() {
403
- }
404
-
405
- }
406
-
407
- `
408
- );
409
-
410
- removeInterface(appTree, filePath, 'OnInit', false);
411
-
412
- const content = appTree.read(filePath)?.toString();
413
- expect(content).toContain("export class AnbindungLazyComponent implements OnChanges, OnDestroy {");
414
-
415
- done();
416
- });
417
-
418
- it('Sollte das Interface (nicht vorhanden) entfernen', (done) => {
419
- const filePath = testOptions.path + '/src/app/test.component.ts';
420
-
421
- appTree.create(
422
- filePath,
423
- `
424
- import { OnChanges, OnDestroy, Component } from '@angular/core';
425
-
426
- @Component({
427
- selector : 'bp-anbindung-lazy',
428
- templateUrl: './anbindung-lazy.component.html'
429
- })
430
- export class AnbindungLazyComponent {
431
-
432
- constructor() {
433
- }
434
-
435
- ngOnInit() {
436
- }
437
-
438
- }
439
-
440
- `
441
- );
442
-
443
- removeInterface(appTree, filePath, 'OnInit', false);
444
-
445
- const content = appTree.read(filePath)?.toString();
446
- expect(content).toContain("export class AnbindungLazyComponent {");
447
-
448
- done();
449
- });
450
-
451
- });
452
-
453
- describe('[Method] addInterface', () => {
454
- it('Sollte das Interface (mit extends - ohne Interface) hinzufügen', (done) => {
455
- const filePath = testOptions.path + '/src/app/test.component.ts';
456
-
457
- appTree.create(
458
- filePath,
459
- `
460
- @Component({
461
- selector : 'bp-anbindung-lazy',
462
- templateUrl: './anbindung-lazy.component.html'
463
- })
464
- export class AnbindungLazyComponent extends Aaa {
465
-
466
- constructor() {
467
- }
468
-
469
- ngOnInit() {
470
- }
471
-
472
- }
473
-
474
- `
475
- );
476
-
477
- addInterface(appTree, filePath, 'OnChanges', false);
478
-
479
- const content = appTree.read(filePath)?.toString();
480
- expect(content).toContain('export class AnbindungLazyComponent extends Aaa implements OnChanges {');
481
-
482
- done();
483
- });
484
-
485
- it('Sollte das Interface (mit extends - mit Interface) hinzufügen', (done) => {
486
- const filePath = testOptions.path + '/src/app/test.component.ts';
487
-
488
- appTree.create(
489
- filePath,
490
- `
491
- @Component({
492
- selector : 'bp-anbindung-lazy',
493
- templateUrl: './anbindung-lazy.component.html'
494
- })
495
- export class AnbindungLazyComponent extends Aaa implements Bbb {
496
-
497
- constructor() {
498
- }
499
-
500
- ngOnInit() {
501
- }
502
-
503
- }
504
-
505
- `
506
- );
507
-
508
- addInterface(appTree, filePath, 'OnChanges', false);
509
-
510
- const content = appTree.read(filePath)?.toString();
511
- expect(content).toContain('export class AnbindungLazyComponent extends Aaa implements Bbb, OnChanges {');
512
-
513
- done();
514
- });
515
-
516
- it('Sollte das Interface (ohne extends - ohne Interface) hinzufügen', (done) => {
517
- const filePath = testOptions.path + '/src/app/test.component.ts';
518
-
519
- appTree.create(
520
- filePath,
521
- `
522
- @Component({
523
- selector : 'bp-anbindung-lazy',
524
- templateUrl: './anbindung-lazy.component.html'
525
- })
526
- export class AnbindungLazyComponent {
527
-
528
- constructor() {
529
- }
530
-
531
- ngOnInit() {
532
- }
533
-
534
- }
535
-
536
- `
537
- );
538
-
539
- addInterface(appTree, filePath, 'OnChanges', false);
540
-
541
- const content = appTree.read(filePath)?.toString();
542
- expect(content).toContain('export class AnbindungLazyComponent implements OnChanges {');
543
-
544
- done();
545
- });
546
-
547
- it('Sollte das Interface (ohne extends - mit Interface) hinzufügen', (done) => {
548
- const filePath = testOptions.path + '/src/app/test.component.ts';
549
-
550
- appTree.create(
551
- filePath,
552
- `
553
- @Component({
554
- selector : 'bp-anbindung-lazy',
555
- templateUrl: './anbindung-lazy.component.html'
556
- })
557
- export class AnbindungLazyComponent implements OnInit {
558
-
559
- constructor() {
560
- }
561
-
562
- ngOnInit() {
563
- }
564
-
565
- }
566
-
567
- `
568
- );
569
-
570
- addInterface(appTree, filePath, 'OnChanges', false);
571
-
572
- const content = appTree.read(filePath)?.toString();
573
- expect(content).toContain('export class AnbindungLazyComponent implements OnInit, OnChanges {');
574
-
575
- done();
576
- });
577
- });
578
-
579
- describe('[Method] addImport', () => {
580
- it('Sollte den Import (kein Import vorhanden) hinzufügen', (done) => {
581
- const filePath = testOptions.path + '/src/app/test.component.ts';
582
-
583
- appTree.create(
584
- filePath,
585
- `
586
- @Component({
587
- selector : 'bp-anbindung-lazy',
588
- templateUrl: './anbindung-lazy.component.html'
589
- })
590
- export class AnbindungLazyComponent implements OnInit {
591
-
592
- constructor() {
593
- }
594
-
595
- ngOnInit() {
596
- }
597
-
598
- }
599
-
600
- `
601
- );
602
-
603
- addImport(appTree, filePath, '@angular/core', 'OnChanges', false);
604
-
605
- const content = appTree.read(filePath)?.toString();
606
-
607
- expect(content).toContain("import { OnChanges } from '@angular/core';");
608
-
609
- done();
610
- });
611
-
612
- it('Sollte den Import (bereits vorhanden) hinzufügen', (done) => {
613
- const filePath = testOptions.path + '/src/app/test.component.ts';
614
-
615
- appTree.create(
616
- filePath,
617
- `
618
- import { OnChanges, OnDestroy, Component } from '@angular/core';
619
-
620
- @Component({
621
- selector : 'bp-anbindung-lazy',
622
- templateUrl: './anbindung-lazy.component.html'
623
- })
624
- export class AnbindungLazyComponent implements OnInit {
625
-
626
- constructor() {
627
- }
628
-
629
- ngOnInit() {
630
- }
631
-
632
- }
633
-
634
- `
635
- );
636
-
637
- addImport(appTree, filePath, '@angular/core', 'OnChanges', false);
638
-
639
- const content = appTree.read(filePath)?.toString();
640
- expect(content).toContain("import { OnChanges, OnDestroy, Component } from '@angular/core';");
641
-
642
- done();
643
- });
644
-
645
- it('Sollte den Import (ein Import) hinzufügen', (done) => {
646
- const filePath = testOptions.path + '/src/app/test.component.ts';
647
-
648
- appTree.create(
649
- filePath,
650
- `
651
- import { OnInit } from '@angular/core';
652
-
653
- @Component({
654
- selector : 'bp-anbindung-lazy',
655
- templateUrl: './anbindung-lazy.component.html'
656
- })
657
- export class AnbindungLazyComponent implements OnInit {
658
-
659
- constructor() {
660
- }
661
-
662
- ngOnInit() {
663
- }
664
-
665
- }
666
-
667
- `
668
- );
669
-
670
- addImport(appTree, filePath, '@angular/core', 'OnChanges', false);
671
-
672
- const content = appTree.read(filePath)?.toString();
673
- expect(content).toContain("import { OnInit, OnChanges } from '@angular/core';");
674
-
675
- done();
676
- });
677
-
678
- it('Sollte den Import (mehrere Imports - einfache Anführungszeichen) hinzufügen', (done) => {
679
- const filePath = testOptions.path + '/src/app/test.component.ts';
680
-
681
- appTree.create(
682
- filePath,
683
- `
684
- import { OnInit, Component } from '@angular/core';
685
-
686
- @Component({
687
- selector : 'bp-anbindung-lazy',
688
- templateUrl: './anbindung-lazy.component.html'
689
- })
690
- export class AnbindungLazyComponent implements OnInit {
691
-
692
- constructor() {
693
- }
694
-
695
- ngOnInit() {
696
- }
697
-
698
- }
699
-
700
- `
701
- );
702
-
703
- addImport(appTree, filePath, '@angular/core', 'OnChanges', false);
704
-
705
- const content = appTree.read(filePath)?.toString();
706
- expect(content).toContain("import { OnInit, Component, OnChanges } from '@angular/core';");
707
-
708
- done();
709
- });
710
-
711
- it('Sollte den Import (mehrere Imports - doppelte Anführungszeichen) hinzufügen', (done) => {
712
- const filePath = testOptions.path + '/src/app/test.component.ts';
713
-
714
- appTree.create(
715
- filePath,
716
- `
717
- import { OnInit, Component } from "@angular/core";
718
-
719
- @Component({
720
- selector : 'bp-anbindung-lazy',
721
- templateUrl: './anbindung-lazy.component.html'
722
- })
723
- export class AnbindungLazyComponent implements OnInit {
724
-
725
- constructor() {
726
- }
727
-
728
- ngOnInit() {
729
- }
730
-
731
- }
732
-
733
- `
734
- );
735
-
736
- addImport(appTree, filePath, '@angular/core', 'OnChanges', false);
737
-
738
- const content = appTree.read(filePath)?.toString();
739
- expect(content).toContain(`import { OnInit, Component, OnChanges } from "@angular/core";`);
740
-
741
- done();
742
- });
743
- });
744
-
745
- describe('[Method] removeImport', () => {
746
- it('Sollte den Import (mehrere Imports - erster Import) entfernen', (done) => {
747
- const filePath = testOptions.path + '/src/app/test.component.ts';
748
-
749
- appTree.create(
750
- filePath,
751
- `
752
- import { OnInit, Component } from '@angular/core';
753
-
754
- @Component({
755
- selector : 'bp-anbindung-lazy',
756
- templateUrl: './anbindung-lazy.component.html'
757
- })
758
- export class AnbindungLazyComponent implements OnInit {
759
-
760
- constructor() {
761
- }
762
-
763
- ngOnInit() {
764
- }
765
-
766
- }
767
-
768
- `
769
- );
770
-
771
- removeImport(appTree, filePath, '@angular/core', 'OnInit', false);
772
-
773
- const content = appTree.read(filePath)?.toString();
774
- expect(content).toContain("import { Component } from '@angular/core';");
775
-
776
- done();
777
- });
778
-
779
- it('Sollte den Import (mehrere Imports - erster Import - doppelte Anführungszeichen) entfernen', (done) => {
780
- const filePath = testOptions.path + '/src/app/test.component.ts';
781
-
782
- appTree.create(
783
- filePath,
784
- `
785
- import { OnInit, Component } from "@angular/core";
786
-
787
- @Component({
788
- selector : 'bp-anbindung-lazy',
789
- templateUrl: './anbindung-lazy.component.html'
790
- })
791
- export class AnbindungLazyComponent implements OnInit {
792
-
793
- constructor() {
794
- }
795
-
796
- ngOnInit() {
797
- }
798
-
799
- }
800
-
801
- `
802
- );
803
-
804
- removeImport(appTree, filePath, '@angular/core', 'OnInit', false);
805
-
806
- const content = appTree.read(filePath)?.toString();
807
- expect(content).toContain(`import { Component } from "@angular/core";`);
808
-
809
- done();
810
- });
811
-
812
- it('Sollte den Import (mehrere Imports - mittlerer Import) entfernen', (done) => {
813
- const filePath = testOptions.path + '/src/app/test.component.ts';
814
-
815
- appTree.create(
816
- filePath,
817
- `
818
- import { OnDestroy, OnInit, Component } from '@angular/core';
819
-
820
- @Component({
821
- selector : 'bp-anbindung-lazy',
822
- templateUrl: './anbindung-lazy.component.html'
823
- })
824
- export class AnbindungLazyComponent implements OnInit {
825
-
826
- constructor() {
827
- }
828
-
829
- ngOnInit() {
830
- }
831
-
832
- }
833
-
834
- `
835
- );
836
-
837
- removeImport(appTree, filePath, '@angular/core', 'OnInit', false);
838
-
839
- const content = appTree.read(filePath)?.toString();
840
- expect(content).toContain("import { OnDestroy, Component } from '@angular/core';");
841
-
842
- done();
843
- });
844
-
845
- it('Sollte den Import (mehrere Imports - mittlerer Import - ohne Leerzeichen) entfernen', (done) => {
846
- const filePath = testOptions.path + '/src/app/test.component.ts';
847
-
848
- appTree.create(
849
- filePath,
850
- `
851
- import { OnDestroy,OnInit,Component } from '@angular/core';
852
-
853
- @Component({
854
- selector : 'bp-anbindung-lazy',
855
- templateUrl: './anbindung-lazy.component.html'
856
- })
857
- export class AnbindungLazyComponent implements OnInit {
858
-
859
- constructor() {
860
- }
861
-
862
- ngOnInit() {
863
- }
864
-
865
- }
866
-
867
- `
868
- );
869
-
870
- removeImport(appTree, filePath, '@angular/core', 'OnInit', false);
871
-
872
- const content = appTree.read(filePath)?.toString();
873
- expect(content).toContain("import { OnDestroy,Component } from '@angular/core';");
874
-
875
- done();
876
- });
877
-
878
- it('Sollte den Import (mehrere Imports - letzter Import) entfernen', (done) => {
879
- const filePath = testOptions.path + '/src/app/test.component.ts';
880
-
881
- appTree.create(
882
- filePath,
883
- `
884
- import { Component, OnInit } from '@angular/core';
885
-
886
- @Component({
887
- selector : 'bp-anbindung-lazy',
888
- templateUrl: './anbindung-lazy.component.html'
889
- })
890
- export class AnbindungLazyComponent implements OnInit {
891
-
892
- constructor() {
893
- }
894
-
895
- ngOnInit() {
896
- }
897
-
898
- }
899
-
900
- `
901
- );
902
-
903
- removeImport(appTree, filePath, '@angular/core', 'OnInit', false);
904
-
905
- const content = appTree.read(filePath)?.toString();
906
- expect(content).toContain("import { Component } from '@angular/core';");
907
-
908
- done();
909
- });
910
-
911
- it('Sollte den Import (nur Paketname) entfernen', (done) => {
912
- const filePath = testOptions.path + '/src/app/test.component.ts';
913
-
914
- appTree.create(
915
- filePath,
916
- `
917
- import '@angular/common/locales/global/de';
918
-
919
- @Component({
920
- selector : 'bp-anbindung-lazy',
921
- templateUrl: './anbindung-lazy.component.html'
922
- })
923
- export class AnbindungLazyComponent implements OnInit {
924
-
925
- constructor() {
926
- }
927
-
928
- ngOnInit() {
929
- }
930
-
931
- }
932
-
933
- `
934
- );
935
-
936
- removeImport(appTree, filePath, '@angular/common/locales/global/de', undefined, false);
937
-
938
- const content = appTree.read(filePath)?.toString();
939
- expect(content).not.toContain("import");
940
-
941
- done();
942
- });
943
-
944
- it('Sollte den Import (nur Paketname - nicht vorhanden) entfernen', (done) => {
945
- const filePath = testOptions.path + '/src/app/test.component.ts';
946
-
947
- appTree.create(
948
- filePath,
949
- `
950
- import '@angular/common/locales/global/de';
951
-
952
- @Component({
953
- selector : 'bp-anbindung-lazy',
954
- templateUrl: './anbindung-lazy.component.html'
955
- })
956
- export class AnbindungLazyComponent implements OnInit {
957
-
958
- constructor() {
959
- }
960
-
961
- ngOnInit() {
962
- }
963
-
964
- }
965
-
966
- `
967
- );
968
-
969
- removeImport(appTree, filePath, 'nichtDaAaa', undefined, false);
970
-
971
- const content = appTree.read(filePath)?.toString();
972
- expect(content).toContain("import '@angular/common/locales/global/de';");
973
-
974
- done();
975
- });
976
-
977
- it('Sollte den Import (nicht vorhanden) entfernen', (done) => {
978
- const filePath = testOptions.path + '/src/app/test.component.ts';
979
-
980
- appTree.create(
981
- filePath,
982
- `
983
- import { Component } from '@angular/core';
984
-
985
- @Component({
986
- selector : 'bp-anbindung-lazy',
987
- templateUrl: './anbindung-lazy.component.html'
988
- })
989
- export class AnbindungLazyComponent implements OnInit {
990
-
991
- constructor() {
992
- }
993
-
994
- ngOnInit() {
995
- }
996
-
997
- }
998
-
999
- `
1000
- );
1001
-
1002
- removeImport(appTree, filePath, '@angular/core', 'OnInit', false);
1003
-
1004
- const content = appTree.read(filePath)?.toString();
1005
- expect(content).toContain("import { Component } from '@angular/core';");
1006
-
1007
- done();
1008
- });
1009
-
1010
- });
1011
-
1012
- describe('[Method] addConstructorContent', () => {
1013
- it('Sollte Inhalt im Konstruktor (mit Konstruktor - append=false) hinzufügen', (done) => {
1014
- const filePath = testOptions.path + '/src/app/test.component.ts';
1015
-
1016
- appTree.create(
1017
- filePath,
1018
- `
1019
- @Component({
1020
- selector : 'bp-anbindung-lazy',
1021
- templateUrl: './anbindung-lazy.component.html'
1022
- })
1023
- export class AnbindungLazyComponent extends Aaa {
1024
-
1025
- constructor() {
1026
- console.log();
1027
- }
1028
-
1029
- ngOnInit() {
1030
- }
1031
-
1032
- }
1033
-
1034
- `
1035
- );
1036
-
1037
- addConstructorContent(appTree, filePath, 'router.initialNavigation();', false);
1038
-
1039
- const content = appTree.read(filePath)?.toString();
1040
- expect(content).toContain('constructor() {\n router.initialNavigation();\n console.log();\n }');
1041
-
1042
- done();
1043
- });
1044
-
1045
- it('Sollte Inhalt im Konstruktor (mit Konstruktor - append=true) hinzufügen', (done) => {
1046
- const filePath = testOptions.path + '/src/app/test.component.ts';
1047
-
1048
- appTree.create(
1049
- filePath,
1050
- `
1051
- @Component({
1052
- selector : 'bp-anbindung-lazy',
1053
- templateUrl: './anbindung-lazy.component.html'
1054
- })
1055
- export class AnbindungLazyComponent extends Aaa {
1056
-
1057
- constructor() {
1058
- console.log();
1059
- }
1060
-
1061
- ngOnInit() {
1062
- }
1063
-
1064
- }
1065
-
1066
- `
1067
- );
1068
-
1069
- addConstructorContent(appTree, filePath, 'router.initialNavigation();', true);
1070
-
1071
- const content = appTree.read(filePath)?.toString();
1072
- expect(content).toContain('constructor() {\n console.log();\n router.initialNavigation();\n }');
1073
-
1074
- done();
1075
- });
1076
-
1077
- it('Sollte Inhalt im Konstruktor (mit leerem Konstruktor - append=false) hinzufügen', (done) => {
1078
- const filePath = testOptions.path + '/src/app/test.component.ts';
1079
-
1080
- appTree.create(
1081
- filePath,
1082
- `
1083
- @Component({
1084
- selector : 'bp-anbindung-lazy',
1085
- templateUrl: './anbindung-lazy.component.html'
1086
- })
1087
- export class AnbindungLazyComponent extends Aaa {
1088
-
1089
- constructor() {}
1090
-
1091
- ngOnInit() {
1092
- }
1093
-
1094
- }
1095
-
1096
- `
1097
- );
1098
-
1099
- addConstructorContent(appTree, filePath, 'router.initialNavigation();', false);
1100
-
1101
- const content = appTree.read(filePath)?.toString();
1102
- expect(content).toContain('constructor() {\n router.initialNavigation();\n }');
1103
-
1104
- done();
1105
- });
1106
-
1107
- it('Sollte Inhalt im Konstruktor (mit leerem Konstruktor - append=true) hinzufügen', (done) => {
1108
- const filePath = testOptions.path + '/src/app/test.component.ts';
1109
-
1110
- appTree.create(
1111
- filePath,
1112
- `
1113
- @Component({
1114
- selector : 'bp-anbindung-lazy',
1115
- templateUrl: './anbindung-lazy.component.html'
1116
- })
1117
- export class AnbindungLazyComponent extends Aaa {
1118
-
1119
- constructor() {}
1120
-
1121
- ngOnInit() {
1122
- }
1123
-
1124
- }
1125
-
1126
- `
1127
- );
1128
-
1129
- addConstructorContent(appTree, filePath, 'router.initialNavigation();', true);
1130
-
1131
- const content = appTree.read(filePath)?.toString();
1132
- expect(content).toContain('constructor() {\n router.initialNavigation();\n }');
1133
-
1134
- done();
1135
- });
1136
-
1137
- it('Sollte Inhalt im Konstruktor (ohne Konstruktor - append=false) hinzufügen', (done) => {
1138
- const filePath = testOptions.path + '/src/app/test.component.ts';
1139
-
1140
- appTree.create(
1141
- filePath,
1142
- `
1143
- @Component({
1144
- selector : 'bp-anbindung-lazy',
1145
- templateUrl: './anbindung-lazy.component.html'
1146
- })
1147
- export class AnbindungLazyComponent extends Aaa {
1148
-
1149
- ngOnInit() {
1150
- }
1151
-
1152
- }
1153
-
1154
- `
1155
- );
1156
-
1157
- addConstructorContent(appTree, filePath, 'router.initialNavigation();', false);
1158
-
1159
- const content = appTree.read(filePath)?.toString();
1160
-
1161
- expect(content).toContain('constructor() {\n router.initialNavigation();\n }');
1162
-
1163
- done();
1164
- });
1165
-
1166
- it('Sollte Inhalt im Konstruktor (ohne Konstruktor - append=true) hinzufügen', (done) => {
1167
- const filePath = testOptions.path + '/src/app/test.component.ts';
1168
-
1169
- appTree.create(
1170
- filePath,
1171
- `
1172
- @Component({
1173
- selector : 'bp-anbindung-lazy',
1174
- templateUrl: './anbindung-lazy.component.html'
1175
- })
1176
- export class AnbindungLazyComponent extends Aaa {
1177
-
1178
- ngOnInit() {
1179
- }
1180
-
1181
- }
1182
-
1183
- `
1184
- );
1185
-
1186
- addConstructorContent(appTree, filePath, 'router.initialNavigation();', true);
1187
-
1188
- const content = appTree.read(filePath)?.toString();
1189
- expect(content).toContain('constructor() {\n router.initialNavigation();\n }');
1190
-
1191
- done();
1192
- });
1193
- });
1194
-
1195
- describe('[Method] addClassProperty', () => {
1196
- it('Sollte eine Property (mit Properties) hinzufügen', (done) => {
1197
- const filePath = testOptions.path + '/src/app/test.component.ts';
1198
-
1199
- appTree.create(
1200
- filePath,
1201
- `
1202
- @Component({
1203
- selector : 'app-root',
1204
- templateUrl: './app.component.html',
1205
- styleUrls : [ './app.component.scss' ]
1206
- })
1207
- export class AppComponent implements OnInit {
1208
-
1209
- luxVersion = '';
1210
- isMaintenanceOrUnauthorized = false;
1211
-
1212
- constructor(private readonly fachService: AccountFacadeService,
1213
- public router: Router, public window: Window,
1214
- private appService: LuxAppService) {
1215
- }
1216
-
1217
- ngOnInit(): void {
1218
- }
1219
-
1220
- }
1221
- `
1222
- );
1223
-
1224
- addClassProperty(appTree, filePath, '@Input() luxAppHeader: \'normal\' | \'minimal\' | \'none\' = \'normal\';');
1225
-
1226
- const content = appTree.read(filePath)?.toString();
1227
- expect(content).toContain(' @Input() luxAppHeader: \'normal\' | \'minimal\' | \'none\' = \'normal\';');
1228
-
1229
- done();
1230
- });
1231
-
1232
- it('Sollte eine Property (ohne Properties) hinzufügen', (done) => {
1233
- const filePath = testOptions.path + '/src/app/test.component.ts';
1234
-
1235
- appTree.create(
1236
- filePath,
1237
- `
1238
- @Component({
1239
- selector : 'app-root',
1240
- templateUrl: './app.component.html',
1241
- styleUrls : [ './app.component.scss' ]
1242
- })
1243
- export class AppComponent implements OnInit {
1244
-
1245
- constructor(private readonly fachService: AccountFacadeService,
1246
- public router: Router, public window: Window,
1247
- private appService: LuxAppService) {
1248
- }
1249
-
1250
- ngOnInit(): void {
1251
- }
1252
-
1253
- }
1254
- `
1255
- );
1256
-
1257
- addClassProperty(appTree, filePath, '@Input() luxAppHeader: \'normal\' | \'minimal\' | \'none\' = \'normal\';');
1258
-
1259
- const content = appTree.read(filePath)?.toString();
1260
- expect(content).toContain(' @Input() luxAppHeader: \'normal\' | \'minimal\' | \'none\' = \'normal\';');
1261
-
1262
- done();
1263
- });
1264
- });
1265
- });