@@ -101,25 +101,17 @@ describe('layout', () => {
101101 expect ( styles [ 3 ] ) . toBe ( 'src/themes/generated/theme.additional.dark.css' ) ;
102102 expect ( styles [ 4 ] ) . toBe ( 'src/themes/generated/theme.additional.css' ) ;
103103
104- const moduleContent = tree . readContent ( '/src/app/app.module.ts' ) ;
105- expect ( moduleContent ) . toContain ( 'import { DxHttpModule }' ) ;
106- expect ( moduleContent )
107- . toContain ( 'import { SideNavOuterToolbarComponent, SideNavInnerToolbarComponent, SingleCardComponent }' ) ;
108- expect ( moduleContent )
109- . toContain ( `import { AuthService, ScreenService, AppInfoService } from './shared/services';` ) ;
110- expect ( moduleContent ) . toContain ( 'import { AppRoutingModule }' ) ;
111- expect ( moduleContent )
112- . toContain ( 'import { FooterComponent, ' +
113- 'ResetPasswordFormComponent, ' +
114- 'CreateAccountFormComponent, ' +
115- 'ChangePasswordFormComponent, ' +
116- 'LoginFormComponent }' ) ;
117-
118104 const appContent = tree . readContent ( '/src/app/app.component.ts' ) ;
105+ expect ( appContent ) . toContain ( 'import { DxHttpModule }' ) ;
106+ expect ( appContent )
107+ . toContain ( 'import { SideNavOuterToolbarComponent, SideNavInnerToolbarComponent }' ) ;
108+ expect ( appContent )
109+ . toContain ( `import { AuthService, ScreenService, AppInfoService } from './shared/services';` ) ;
110+ expect ( appContent )
111+ . toContain ( 'import { FooterComponent }' ) ;
119112 expect ( appContent ) . toContain ( 'templateUrl: \'./app.component.html\',' ) ;
120113 expect ( appContent ) . toContain ( 'styleUrls: [\'./app.component.scss\']' ) ;
121114 expect ( appContent ) . toContain ( 'selector: \'app-root\',' ) ;
122- expect ( appContent ) . toContain ( `import { AuthService, ScreenService, AppInfoService } from './shared/services';` ) ;
123115
124116 const navigationMenu = tree . readContent (
125117 '/src/app/shared/components/side-navigation-menu/side-navigation-menu.component.ts' ) ;
@@ -244,26 +236,14 @@ describe('layout', () => {
244236 } ) ;
245237
246238 it ( 'should add routing to layout' , async ( ) => {
247- let newAppTree = await schematicRunner . runSchematic ( 'workspace' , workspaceOptions ) ;
248-
249- appOptions . routing = false ;
250- newAppTree = await schematicRunner . runSchematic (
251- 'application' , appOptions , newAppTree ) ;
252-
253239 const runner = new SchematicTestRunner ( 'schematics' , collectionPath ) ;
254240 const tree = await runner . runSchematic ( 'add-layout' , options , appTree ) ;
255241
256242 expect ( tree . files ) . toContain ( '/src/app/app.routes.ts' ) ;
257- const moduleContent = tree . readContent ( '/src/app/app.routes.ts' ) ;
258- expect ( moduleContent )
259- . toMatch ( / i m p o r t s : \s \[ R o u t e r M o d u l e \. f o r R o o t \( r o u t e s , { u s e H a s h : t r u e } \) \] , / ) ;
260-
261- expect ( moduleContent )
262- . toContain ( `{
263- path: 'login-form',
264- component: LoginFormComponent,
265- canActivate: [ AuthGuardService ]
266- }` ) ;
243+ const routesContent = tree . readContent ( '/src/app/app.routes.ts' ) ;
244+
245+ expect ( routesContent )
246+ . toContain ( `{\r\n path: 'login-form',\r\n component: LoginFormComponent,\r\n canActivate: [ AuthGuardService ]\r\n },` ) ;
267247 } ) ;
268248
269249 it ( 'should use selected layout' , async ( ) => {
0 commit comments