@@ -16,71 +16,56 @@ describe('side-menu schematic', () => {
1616
1717 beforeEach ( async ( ) => {
1818 runner = new SchematicTestRunner ( 'schematics' , require . resolve ( '../../collection.json' ) ) ;
19- appTree = await createTestApp ( runner , { standalone : true } ) ;
19+ appTree = await createTestApp ( runner , { standalone : false } ) ;
2020 } ) ;
2121
2222 it ( 'should create side-menu files' , async ( ) => {
2323 const options = { ...defaultOptions } ;
2424 const tree = await runner . runSchematic ( 'sidemenu' , options , appTree ) ;
25- const files = tree . files ;
26- expect ( files ) . toEqual (
25+
26+ expect ( tree . files ) . toEqual (
2727 jasmine . arrayContaining ( [
2828 '/projects/ng-zorro/src/app/app.component.html' ,
2929 '/projects/ng-zorro/src/app/app.component.css' ,
3030 '/projects/ng-zorro/src/app/app.component.ts' ,
31- '/projects/ng-zorro/src/app/app.routes .ts' ,
32- '/projects/ng-zorro/src/app/pages/welcome/welcome.routes .ts' ,
31+ '/projects/ng-zorro/src/app/app-routing.module .ts' ,
32+ '/projects/ng-zorro/src/app/pages/welcome/welcome-routing.module .ts' ,
3333 '/projects/ng-zorro/src/app/pages/welcome/welcome.component.ts' ,
3434 '/projects/ng-zorro/src/app/pages/welcome/welcome.component.css' ,
3535 '/projects/ng-zorro/src/app/pages/welcome/welcome.component.html'
3636 ] )
3737 ) ;
3838 } ) ;
3939
40- it ( 'should set the style preprocessor correctly' , async ( ) => {
41- const options = { ...defaultOptions , style : Style . Less } ;
42- const tree = await runner . runSchematic ( 'sidemenu' , options , appTree ) ;
43- const files = tree . files ;
44- const appContent = getFileContent ( tree , '/projects/ng-zorro/src/app/app.component.ts' ) ;
45- const welcomeContent = getFileContent ( tree , '/projects/ng-zorro/src/app/pages/welcome/welcome.component.ts' ) ;
46- expect ( appContent ) . toContain ( 'app.component.less' ) ;
47- expect ( welcomeContent ) . toContain ( 'welcome.component.less' ) ;
48-
49- expect ( files ) . toEqual (
50- jasmine . arrayContaining ( [
51- '/projects/ng-zorro/src/app/app.component.less' ,
52- '/projects/ng-zorro/src/app/pages/welcome/welcome.component.less'
53- ] )
54- ) ;
55- } ) ;
56-
57- xit ( 'should fall back to the @schematics/angular:component option value' , async ( ) => {
58- const options = { ...defaultOptions , template : 'sidemenu' } ;
59- appTree = await createTestApp ( runner , { style : Style . Less } ) ;
60- const tree = await runner . runSchematic ( 'ng-add' , options , appTree ) ;
61-
62- expect ( tree . files ) . toEqual (
63- jasmine . arrayContaining ( [
64- '/projects/ng-zorro/src/app/app.component.less' ,
65- '/projects/ng-zorro/src/app/pages/welcome/welcome.component.less'
66- ] )
67- ) ;
68- } ) ;
69-
70- xit ( 'should fall back to the @schematics/angular:component option value' , async ( ) => {
71- const options = { ...defaultOptions , template : 'sidemenu' } ;
72- appTree = await createTestApp ( runner , { inlineStyle : true } ) ;
73- const tree = await runner . runSchematic ( 'ng-add' , options , appTree ) ;
74-
75- expect ( tree . files ) . not . toEqual ( '/projects/ng-zorro/src/app/pages/welcome/welcome.component.css' ) ;
76- } ) ;
77-
78- xit ( 'should fall back to the @schematics/angular:component option value' , async ( ) => {
79- const options = { ...defaultOptions , template : 'sidemenu' } ;
80- appTree = await createTestApp ( runner , { inlineTemplate : true } ) ;
81- const tree = await runner . runSchematic ( 'ng-add' , options , appTree ) ;
82-
83- expect ( tree . files ) . not . toEqual ( '/projects/ng-zorro/src/app/pages/welcome/welcome.component.html' ) ;
40+ describe ( 'style option' , ( ) => {
41+ it ( 'should set the style preprocessor correctly' , async ( ) => {
42+ const options = { ...defaultOptions , style : Style . Less } ;
43+ const tree = await runner . runSchematic ( 'sidemenu' , options , appTree ) ;
44+ const appContent = getFileContent ( tree , '/projects/ng-zorro/src/app/app.component.ts' ) ;
45+ const welcomeContent = getFileContent ( tree , '/projects/ng-zorro/src/app/pages/welcome/welcome.component.ts' ) ;
46+ expect ( appContent ) . toContain ( 'app.component.less' ) ;
47+ expect ( welcomeContent ) . toContain ( 'welcome.component.less' ) ;
48+
49+ expect ( tree . files ) . toEqual (
50+ jasmine . arrayContaining ( [
51+ '/projects/ng-zorro/src/app/app.component.less' ,
52+ '/projects/ng-zorro/src/app/pages/welcome/welcome.component.less'
53+ ] )
54+ ) ;
55+ } ) ;
56+
57+ it ( 'should fall back to the @schematics/angular:component option value' , async ( ) => {
58+ const options = { ...defaultOptions , template : 'sidemenu' } ;
59+ appTree = await createTestApp ( runner , { style : Style . Less , standalone : false } ) ;
60+ const tree = await runner . runSchematic ( 'ng-add' , options , appTree ) ;
61+
62+ expect ( tree . files ) . toEqual (
63+ jasmine . arrayContaining ( [
64+ '/projects/ng-zorro/src/app/app.component.less' ,
65+ '/projects/ng-zorro/src/app/pages/welcome/welcome.component.less'
66+ ] )
67+ ) ;
68+ } ) ;
8469 } ) ;
8570
8671 it ( 'should set the prefix correctly' , async ( ) => {
0 commit comments