@@ -37,7 +37,9 @@ describe('Store Schematic', () => {
3737 const options = { ...defaultOptions } ;
3838
3939 const tree = schematicRunner . runSchematic ( 'store' , options , appTree ) ;
40+
4041 const files = tree . files ;
42+
4143 expect (
4244 files . indexOf ( `${ projectPath } /src/app/reducers/index.ts` )
4345 ) . toBeGreaterThanOrEqual ( 0 ) ;
@@ -56,11 +58,32 @@ describe('Store Schematic', () => {
5658
5759 const tree = schematicRunner . runSchematic ( 'store' , options , appTree ) ;
5860 const files = tree . files ;
61+
5962 expect (
6063 files . indexOf ( `${ specifiedProjectPath } /src/lib/reducers/index.ts` )
6164 ) . toBeGreaterThanOrEqual ( 0 ) ;
6265 } ) ;
6366
67+ it ( 'should create the initial store to defaultProject if project is not provided' , ( ) => {
68+ const options = {
69+ ...defaultOptions ,
70+ project : undefined ,
71+ } ;
72+
73+ const specifiedProjectPath = getTestProjectPath ( defaultWorkspaceOptions , {
74+ ...defaultAppOptions ,
75+ name : defaultWorkspaceOptions . defaultProject ,
76+ } ) ;
77+
78+ const tree = schematicRunner . runSchematic ( 'store' , options , appTree ) ;
79+
80+ const files = tree . files ;
81+
82+ expect (
83+ files . indexOf ( `${ specifiedProjectPath } /src/app/reducers/index.ts` )
84+ ) . toBeGreaterThanOrEqual ( 0 ) ;
85+ } ) ;
86+
6487 it ( 'should not be provided by default' , ( ) => {
6588 const options = { ...defaultOptions } ;
6689
0 commit comments