Skip to content

Commit 6aebbbb

Browse files
committed
fix(igx-ts-legacy): update tests
1 parent 117dd2c commit 6aebbbb

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

spec/acceptance/add-spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ describe("Add command", () => {
173173
}));
174174
fs.mkdirSync(`./src`);
175175
fs.mkdirSync(`./src/app`);
176-
fs.writeFileSync("src/app/app-routing.module.ts", "const routes: Routes = [];");
176+
fs.writeFileSync("src/app/app-routing-module.ts", "const routes: Routes = [];");
177177
fs.writeFileSync("src/app/app-module.ts", `@NgModule({
178178
declarations: [
179179
App,
@@ -193,7 +193,7 @@ describe("Add command", () => {
193193
expect(fs.existsSync(componentPath)).toBeTruthy();
194194
// file contents:
195195
expect(fs.readFileSync(componentPath, "utf-8")).toContain("export class TestViewComponent");
196-
expect(fs.readFileSync("src/app/app-routing.module.ts", "utf-8").replace(/\s/g, "")).toBe(
196+
expect(fs.readFileSync("src/app/app-routing-module.ts", "utf-8").replace(/\s/g, "")).toBe(
197197
`import { TestViewComponent } from "./components/test-view/test-view.component";
198198
const routes: Routes = [{ path: "test-view", component: TestViewComponent, data: { text: "Test view" } }];
199199
`.replace(/\s/g, "")
@@ -260,7 +260,7 @@ describe("Add command", () => {
260260
}));
261261
fs.mkdirSync(`./src`);
262262
fs.mkdirSync(`./src/app`);
263-
fs.writeFileSync("src/app/app-routing.module.ts", "const routes: Routes = [];");
263+
fs.writeFileSync("src/app/app-routing-module.ts", "const routes: Routes = [];");
264264
fs.writeFileSync("src/app/app-module.ts", `@NgModule({
265265
declarations: [
266266
App,
@@ -283,7 +283,7 @@ describe("Add command", () => {
283283
expect(fs.existsSync(componentPath)).toBeTruthy();
284284
// file contents:
285285
expect(fs.readFileSync(componentPath, "utf-8")).toContain("export class TestView");
286-
expect(fs.readFileSync("src/app/app-routing.module.ts", "utf-8")).toBe(
286+
expect(fs.readFileSync("src/app/app-routing-module.ts", "utf-8")).toBe(
287287
`import { TestView } from './test-view/test-view';` + EOL +
288288
`const routes: Routes = [{ path: 'test-view', component: TestView, data: { text: 'Test view' } }];` + EOL
289289
);
@@ -335,7 +335,7 @@ export class AppModule {
335335
}));
336336
fs.mkdirSync(`./src`);
337337
fs.mkdirSync(`./src/app`);
338-
fs.writeFileSync("src/app/app-routing.module.ts", "const routes: Routes = [];");
338+
fs.writeFileSync("src/app/app-routing-module.ts", "const routes: Routes = [];");
339339
fs.writeFileSync("src/app/app-module.ts", `@NgModule({
340340
declarations: [
341341
App,
@@ -360,7 +360,7 @@ export class AppModule {
360360
// file contents:
361361
expect(fs.readFileSync(componentPath, "utf-8")).toContain("export class TestNestedFolders");
362362

363-
expect(fs.readFileSync("src/app/app-routing.module.ts", "utf-8")).toBe(
363+
expect(fs.readFileSync("src/app/app-routing-module.ts", "utf-8")).toBe(
364364
`import { TestNestedFolders } from './${componentFolder}/test-nested-folders';` + EOL +
365365
// tslint:disable-next-line:max-line-length
366366
`const routes: Routes = [{ path: 'test-nested-folders', component: TestNestedFolders, data: { text: 'Test Nested Folders' } }];` + EOL

spec/unit/add-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ describe("Unit - Add command", () => {
269269
};
270270
spyOn(App.container, "get").and.returnValue(mockVirtFs);
271271
spyOn(mockVirtFs, "fileExists").and.callFake(file => {
272-
if (file === "src/app/app-routing.module.ts") {
272+
if (file === "src/app/app-routing-module.ts") {
273273
return true;
274274
}
275275
});

spec/unit/base-templates/AngularTemplate-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ describe("Unit - AngularTemplate Base", () => {
133133
const templ = new TestTemplate();
134134
templ.registerInProject("target/path", "view name");
135135
expect(helpers.AngularTypeScriptFileUpdate)
136-
.toHaveBeenCalledWith(path.join("target/path", "src/app/app-routing.module.ts"), false, { singleQuotes: false });
136+
.toHaveBeenCalledWith(path.join("target/path", "src/app/app-routing-module.ts"), false, { singleQuotes: false });
137137
expect(helpers.tsUpdateMock.addRoute).toHaveBeenCalledWith(
138138
{
139139
path: 'view-name',

spec/unit/ts-transform/AngularTypeScriptFileUpdate-spec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { RouterModule, Routes } from '@angular/router';
1212
1313
import { NotFound } from './error-routing/not-found/not-found';
1414
import { UncaughtError } from './error-routing/error/uncaught-error';
15-
import { ErrorRoutingModule } from './error-routing/error-routing.module';
15+
import { ErrorRoutingModule } from './error-routing/error-routing-module';
1616
1717
export const routes: Routes = [
1818
{ path: 'error', component: UncaughtError },
@@ -144,7 +144,7 @@ describe('Unit - AngularTypeScriptFileUpdate', () => {
144144
EOL +
145145
`import { UncaughtError } from './error-routing/error/uncaught-error';` +
146146
EOL +
147-
`import { ErrorRoutingModule } from './error-routing/error-routing.module';` +
147+
`import { ErrorRoutingModule } from './error-routing/error-routing-module';` +
148148
EOL +
149149
EOL +
150150
`export const routes: Routes = [` +
@@ -275,7 +275,7 @@ describe('Unit - AngularTypeScriptFileUpdate', () => {
275275
EOL +
276276
`import { UncaughtError } from './error-routing/error/uncaught-error';` +
277277
EOL +
278-
`import { ErrorRoutingModule } from './error-routing/error-routing.module';` +
278+
`import { ErrorRoutingModule } from './error-routing/error-routing-module';` +
279279
EOL +
280280
`import { TestRouteComponent } from 'path/to/module';` +
281281
EOL +
@@ -333,7 +333,7 @@ describe('Unit - AngularTypeScriptFileUpdate', () => {
333333
EOL +
334334
`import { UncaughtError } from './error-routing/error/uncaught-error';` +
335335
EOL +
336-
`import { ErrorRoutingModule } from './error-routing/error-routing.module';` +
336+
`import { ErrorRoutingModule } from './error-routing/error-routing-module';` +
337337
EOL +
338338
EOL +
339339
`export const routes: Routes = [` +
@@ -388,7 +388,7 @@ describe('Unit - AngularTypeScriptFileUpdate', () => {
388388
EOL +
389389
`import { UncaughtError } from './error-routing/error/uncaught-error';` +
390390
EOL +
391-
`import { ErrorRoutingModule } from './error-routing/error-routing.module';` +
391+
`import { ErrorRoutingModule } from './error-routing/error-routing-module';` +
392392
EOL +
393393
EOL +
394394
`export const routes: Routes = [` +
@@ -445,7 +445,7 @@ describe('Unit - AngularTypeScriptFileUpdate', () => {
445445
EOL +
446446
`import { UncaughtError } from './error-routing/error/uncaught-error';` +
447447
EOL +
448-
`import { ErrorRoutingModule } from './error-routing/error-routing.module';` +
448+
`import { ErrorRoutingModule } from './error-routing/error-routing-module';` +
449449
EOL +
450450
EOL +
451451
`export const routes: Routes = [` +
@@ -515,7 +515,7 @@ describe('Unit - AngularTypeScriptFileUpdate', () => {
515515
EOL +
516516
`import { UncaughtError } from './error-routing/error/uncaught-error';` +
517517
EOL +
518-
`import { ErrorRoutingModule } from './error-routing/error-routing.module';` +
518+
`import { ErrorRoutingModule } from './error-routing/error-routing-module';` +
519519
EOL +
520520
`import { ParentComponent } from 'path/to/parent';` +
521521
EOL +
@@ -618,7 +618,7 @@ describe('Unit - AngularTypeScriptFileUpdate', () => {
618618
EOL +
619619
`import { UncaughtError } from './error-routing/error/uncaught-error';` +
620620
EOL +
621-
`import { ErrorRoutingModule } from './error-routing/error-routing.module';` +
621+
`import { ErrorRoutingModule } from './error-routing/error-routing-module';` +
622622
EOL +
623623
`import { ParentComponent } from 'path/to/parent';` +
624624
EOL +
@@ -731,7 +731,7 @@ describe('Unit - AngularTypeScriptFileUpdate', () => {
731731
EOL +
732732
`import { UncaughtError } from './error-routing/error/uncaught-error';` +
733733
EOL +
734-
`import { ErrorRoutingModule } from './error-routing/error-routing.module';` +
734+
`import { ErrorRoutingModule } from './error-routing/error-routing-module';` +
735735
EOL +
736736
`import { ParentComponent } from 'path/to/parent';` +
737737
EOL +

0 commit comments

Comments
 (0)