@@ -657,6 +657,67 @@ describe('ng-add schematic', () => {
657
657
) ;
658
658
} ) ;
659
659
} ) ;
660
+
661
+ describe ( 'using lower dependency builder' , ( ) => {
662
+ beforeEach ( ( ) => {
663
+ const config = {
664
+ version : 1 ,
665
+ projects : {
666
+ material : {
667
+ projectType : 'application' ,
668
+ root : 'projects/material' ,
669
+ sourceRoot : 'projects/material/src' ,
670
+ prefix : 'app' ,
671
+ architect : {
672
+ build : {
673
+ builder : '@angular/build:application' ,
674
+ options : {
675
+ outputPath : 'dist/material' ,
676
+ index : 'projects/material/src/index.html' ,
677
+ browser : 'projects/material/src/main.ts' ,
678
+ styles : [ 'projects/material/src/styles.css' ] ,
679
+ } ,
680
+ } ,
681
+ } ,
682
+ } ,
683
+ } ,
684
+ } ;
685
+
686
+ appTree . overwrite ( '/angular.json' , JSON . stringify ( config , null , 2 ) ) ;
687
+ } ) ;
688
+
689
+ it ( 'should add a theme' , async ( ) => {
690
+ const tree = await runner . runSchematic ( 'ng-add-setup-project' , baseOptions , appTree ) ;
691
+ const workspace = await getWorkspace ( tree ) ;
692
+ const project = getProjectFromWorkspace ( workspace , baseOptions . project ) ;
693
+
694
+ expectProjectStyleFile ( project , '@angular/material/prebuilt-themes/azure-blue.css' ) ;
695
+ } ) ;
696
+
697
+ it ( 'should add material app styles' , async ( ) => {
698
+ const tree = await runner . runSchematic ( 'ng-add-setup-project' , baseOptions , appTree ) ;
699
+ const workspace = await getWorkspace ( tree ) ;
700
+ const project = getProjectFromWorkspace ( workspace , baseOptions . project ) ;
701
+
702
+ const defaultStylesPath = getProjectStyleFile ( project ) ! ;
703
+ const htmlContent = tree . read ( defaultStylesPath ) ! . toString ( ) ;
704
+
705
+ expect ( htmlContent ) . toContain ( 'html, body { height: 100%; }' ) ;
706
+ expect ( htmlContent ) . toContain (
707
+ 'body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }' ,
708
+ ) ;
709
+ } ) ;
710
+
711
+ it ( 'should add the provideAnimationsAsync to the project module' , async ( ) => {
712
+ const tree = await runner . runSchematic ( 'ng-add-setup-project' , baseOptions , appTree ) ;
713
+ const fileContent = getFileContent ( tree , '/projects/material/src/app/app.module.ts' ) ;
714
+
715
+ expect ( fileContent ) . toContain ( 'provideAnimationsAsync()' ) ;
716
+ expect ( fileContent ) . toContain (
717
+ `import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';` ,
718
+ ) ;
719
+ } ) ;
720
+ } ) ;
660
721
} ) ;
661
722
662
723
describe ( 'ng-add schematic - library project' , ( ) => {
0 commit comments