@@ -309,4 +309,46 @@ describe('M2 theming migration', () => {
309
309
`@include matx.something-not-theming-related();` ,
310
310
] ) ;
311
311
} ) ;
312
+
313
+ it ( 'should migrate usages of the M2 theming APIs in a file with CRLF endings' , async ( ) => {
314
+ const result = await setup (
315
+ [
316
+ `@use '@angular/material' as mat;` ,
317
+
318
+ `$my-primary: mat.define-palette(mat.$indigo-palette, 500);` ,
319
+ `$my-accent: mat.define-palette(mat.$pink-palette, A200, A100, A400);` ,
320
+ `$my-warn: mat.define-palette(mat.$red-palette);` ,
321
+
322
+ `$my-theme: mat.define-light-theme((` ,
323
+ ` color: (` ,
324
+ ` primary: $my-primary,` ,
325
+ ` accent: $my-accent,` ,
326
+ ` warn: $my-warn,` ,
327
+ ` ),` ,
328
+ ` typography: mat.define-typography-config(),` ,
329
+ ` density: 0,` ,
330
+ `));` ,
331
+ `@include mat.all-component-themes($my-theme);` ,
332
+ ] . join ( '\r\n' ) ,
333
+ ) ;
334
+
335
+ expect ( result . split ( '\r\n' ) ) . toEqual ( [
336
+ `@use '@angular/material' as mat;` ,
337
+
338
+ `$my-primary: mat.m2-define-palette(mat.$m2-indigo-palette, 500);` ,
339
+ `$my-accent: mat.m2-define-palette(mat.$m2-pink-palette, A200, A100, A400);` ,
340
+ `$my-warn: mat.m2-define-palette(mat.$m2-red-palette);` ,
341
+
342
+ `$my-theme: mat.m2-define-light-theme((` ,
343
+ ` color: (` ,
344
+ ` primary: $my-primary,` ,
345
+ ` accent: $my-accent,` ,
346
+ ` warn: $my-warn,` ,
347
+ ` ),` ,
348
+ ` typography: mat.m2-define-typography-config(),` ,
349
+ ` density: 0,` ,
350
+ `));` ,
351
+ `@include mat.all-component-themes($my-theme);` ,
352
+ ] ) ;
353
+ } ) ;
312
354
} ) ;
0 commit comments