@@ -57,6 +57,26 @@ describe('Container Schematic', () => {
5757 expect ( content ) . toMatch ( / i m p o r t \* a s f r o m S t o r e f r o m ' ..\/ r e d u c e r s ' ; / ) ;
5858 } ) ;
5959
60+ it ( 'should remove .ts from the state path if provided' , ( ) => {
61+ const options = { ...defaultOptions , state : 'reducers/foo.ts' } ;
62+ appTree . create ( `${ projectPath } /src/app/reducers/foo.ts` , '' ) ;
63+ const tree = schematicRunner . runSchematic ( 'container' , options , appTree ) ;
64+ const content = tree . readContent (
65+ `${ projectPath } /src/app/foo/foo.component.ts`
66+ ) ;
67+ expect ( content ) . toMatch ( / i m p o r t \* a s f r o m S t o r e f r o m ' ..\/ r e d u c e r s \/ f o o ' ; / ) ;
68+ } ) ;
69+
70+ it ( 'should remove index.ts from the state path if provided' , ( ) => {
71+ const options = { ...defaultOptions , state : 'reducers/index.ts' } ;
72+ appTree . create ( `${ projectPath } /src/app/reducers/index.ts` , '' ) ;
73+ const tree = schematicRunner . runSchematic ( 'container' , options , appTree ) ;
74+ const content = tree . readContent (
75+ `${ projectPath } /src/app/foo/foo.component.ts`
76+ ) ;
77+ expect ( content ) . toMatch ( / i m p o r t \* a s f r o m S t o r e f r o m ' ..\/ r e d u c e r s ' ; / ) ;
78+ } ) ;
79+
6080 it ( 'should import Store into the component' , ( ) => {
6181 const options = { ...defaultOptions , state : 'reducers' } ;
6282 appTree . create ( `${ projectPath } /src/app/reducers` , '' ) ;
0 commit comments