@@ -241,28 +241,27 @@ describe('layout', () => {
241241
242242 expect ( tree . files ) . toContain ( '/src/app/app.routes.ts' ) ;
243243 const routesContent = tree . readContent ( '/src/app/app.routes.ts' ) ;
244-
244+
245245 expect ( routesContent )
246246 . toContain ( `import { AuthGuardService } from './shared/services';` ) ;
247- expect ( routesContent )
248- . toContain ( `import { LoginFormComponent } from './shared/components';` ) ;
249- expect ( routesContent )
250- . toContain ( `import { ResetPasswordFormComponent } from './shared/components';` ) ;
251- expect ( routesContent )
252- . toContain ( `import { CreateAccountFormComponent } from './shared/components';` ) ;
253- expect ( routesContent )
254- . toContain ( `import { ChangePasswordFormComponent } from './shared/components';` ) ;
247+ const loginFormComponentMatch = routesContent . match ( / \b L o g i n F o r m C o m p o n e n t \b / g ) ;
248+ const resetPasswordFormComponentMatch = routesContent . match ( / \b R e s e t P a s s w o r d F o r m C o m p o n e n t \b / g ) ;
249+ const createAccountFormComponentMatch = routesContent . match ( / \b C r e a t e A c c o u n t F o r m C o m p o n e n t \b / g ) ;
250+ const changePasswordFormComponentMatch = routesContent . match ( / \b C h a n g e P a s s w o r d F o r m C o m p o n e n t \b / g ) ;
251+ expect ( loginFormComponentMatch ?. length ) . toBe ( 2 ) ;
252+ expect ( resetPasswordFormComponentMatch ?. length ) . toBe ( 2 ) ;
253+ expect ( createAccountFormComponentMatch ?. length ) . toBe ( 2 ) ;
254+ expect ( changePasswordFormComponentMatch ?. length ) . toBe ( 2 ) ;
255255
256256 expect ( routesContent )
257- . toContain ( `{\n path: 'login-form',\n component: LoginFormComponent,\n canActivate: [ AuthGuardService ]\n }, ` ) ;
257+ . toContain ( `path: 'login-form'` ) ;
258258 expect ( routesContent )
259- . toContain ( `{\n path: 'reset-password',\n component: ResetPasswordFormComponent,\n canActivate: [ AuthGuardService ]\n }, ` ) ;
259+ . toContain ( `path: 'reset-password'` ) ;
260260 expect ( routesContent )
261- . toContain ( `{\n path: 'create-account',\n component: CreateAccountFormComponent,\n canActivate: [ AuthGuardService ]\n }, ` ) ;
261+ . toContain ( `path: 'create-account'` ) ;
262262 expect ( routesContent )
263- . toContain ( `{\n path: 'change-password',\n component: ChangePasswordFormComponent,\n canActivate: [ AuthGuardService ]\n },` ) ;
264- } ) ;
265-
263+ . toContain ( `path: 'change-password/:recoveryCode'` ) ;
264+ } ) ;
266265 it ( 'should use selected layout' , async ( ) => {
267266 const runner = new SchematicTestRunner ( 'schematics' , collectionPath ) ;
268267 options . layout = 'side-nav-inner-toolbar' ;
0 commit comments