@@ -57,6 +57,26 @@ describe('Container Schematic', () => {
57
57
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 ' ; / ) ;
58
58
} ) ;
59
59
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
+
60
80
it ( 'should import Store into the component' , ( ) => {
61
81
const options = { ...defaultOptions , state : 'reducers' } ;
62
82
appTree . create ( `${ projectPath } /src/app/reducers` , '' ) ;
0 commit comments