Skip to content

Commit e0c16ca

Browse files
committed
fix(tests): Add tests to ensure correct imports in toutes file
1 parent 7918b3c commit e0c16ca

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

packages/devextreme-schematics/src/add-layout/index_spec.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,10 +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+
245+
expect(routesContent)
246+
.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';`);
244255

245256
expect(routesContent)
246257
.toContain(`{\n path: 'login-form',\n component: LoginFormComponent,\n canActivate: [ AuthGuardService ]\n },`);
247-
});
258+
expect(routesContent)
259+
.toContain(`{\n path: 'reset-password',\n component: ResetPasswordFormComponent,\n canActivate: [ AuthGuardService ]\n },`);
260+
expect(routesContent)
261+
.toContain(`{\n path: 'create-account',\n component: CreateAccountFormComponent,\n canActivate: [ AuthGuardService ]\n },`);
262+
expect(routesContent)
263+
.toContain(`{\n path: 'change-password',\n component: ChangePasswordFormComponent,\n canActivate: [ AuthGuardService ]\n },`);
264+
});
248265

249266
it('should use selected layout', async () => {
250267
const runner = new SchematicTestRunner('schematics', collectionPath);

0 commit comments

Comments
 (0)