Skip to content

Commit 493905f

Browse files
CopilotHristo313
andauthored
refactor(igx-ts): Clean spec files from unneeded module imports (#1544)
Co-authored-by: Hristo313 <57346540+Hristo313@users.noreply.github.com>
1 parent 87a9404 commit 493905f

File tree

17 files changed

+25
-168
lines changed

17 files changed

+25
-168
lines changed

packages/igx-templates/igx-ts/custom-templates/awesome-grid/files/src/app/__path__/__filePrefix__.spec.ts

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
2-
import { FormsModule } from '@angular/forms';
3-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
4-
import {
5-
IgxAvatarModule,
6-
IgxBadgeModule,
7-
IgxGridModule,
8-
IgxIconModule,
9-
IgxInputGroupModule,
10-
IgxProgressBarModule,
11-
IgxSwitchModule
12-
} from '<%=igxPackage%>';
13-
import { IgxSparklineCoreModule, IgxSparklineModule } from 'igniteui-angular-charts';
2+
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
143
import { <%=ClassName%> } from './<%=filePrefix%>';
154

165
describe('<%=ClassName%>', () => {
@@ -20,17 +9,7 @@ describe('<%=ClassName%>', () => {
209
beforeEach(async () => {
2110
await TestBed.configureTestingModule({
2211
imports: [
23-
FormsModule,
24-
BrowserAnimationsModule,
25-
IgxGridModule,
26-
IgxProgressBarModule,
27-
IgxAvatarModule,
28-
IgxBadgeModule,
29-
IgxIconModule,
30-
IgxSwitchModule,
31-
IgxInputGroupModule,
32-
IgxSparklineModule,
33-
IgxSparklineCoreModule,
12+
NoopAnimationsModule,
3413
<%=ClassName%>
3514
]
3615
})

packages/igx-templates/igx-ts/custom-templates/crm-grid/files/src/app/__path__/__filePrefix__.spec.ts

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,16 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
2-
import { FormsModule } from '@angular/forms';
3-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
2+
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
43
import { IgxExcelExporterService, IgxCsvExporterService } from '<%=igxPackage%>';
5-
import { IgxSparklineModule, IgxSparklineCoreModule } from 'igniteui-angular-charts';
6-
74
import { <%=ClassName%> } from './<%=filePrefix%>';
85

9-
import {
10-
IgxGridModule,
11-
IgxAvatarModule,
12-
IgxBadgeModule,
13-
IgxButtonModule,
14-
IgxIconModule,
15-
IgxInputGroupModule,
16-
IgxProgressBarModule,
17-
IgxRippleModule,
18-
IgxSwitchModule,
19-
IgxToggleModule,
20-
IgxCheckboxModule
21-
} from '<%=igxPackage%>';
226
describe('<%=ClassName%>', () => {
237
let component: <%=ClassName%>;
248
let fixture: ComponentFixture<<%=ClassName%>>;
259

2610
beforeEach(async () => {
2711
await TestBed.configureTestingModule({
2812
imports: [
29-
FormsModule,
30-
BrowserAnimationsModule,
31-
IgxGridModule,
32-
IgxAvatarModule,
33-
IgxBadgeModule,
34-
IgxButtonModule,
35-
IgxIconModule,
36-
IgxInputGroupModule,
37-
IgxProgressBarModule,
38-
IgxRippleModule,
39-
IgxSwitchModule,
40-
IgxToggleModule,
41-
IgxCheckboxModule,
42-
IgxSparklineModule,
43-
IgxSparklineCoreModule,
13+
NoopAnimationsModule,
4414
<%=ClassName%>
4515
],
4616
providers: [IgxExcelExporterService, IgxCsvExporterService]

packages/igx-templates/igx-ts/custom-templates/fintech-grid/files/src/app/__path__/__filePrefix__.spec.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
2-
import { FormsModule } from '@angular/forms';
3-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
2+
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
43
import { <%=ClassName%> } from './<%=filePrefix%>';
5-
import { IgxGridModule, IgxButtonModule, IgxSwitchModule, IgxSliderModule, IgxCheckboxModule, IgxDialogModule } from '<%=igxPackage%>';
6-
import { IgxCategoryChartModule } from 'igniteui-angular-charts';
74

85
describe('<%=ClassName%>', () => {
96
let component: <%=ClassName%>;
@@ -12,15 +9,7 @@ describe('<%=ClassName%>', () => {
129
beforeEach(async () => {
1310
await TestBed.configureTestingModule({
1411
imports: [
15-
FormsModule,
16-
BrowserAnimationsModule,
17-
IgxGridModule,
18-
IgxDialogModule,
19-
IgxCategoryChartModule,
20-
IgxButtonModule,
21-
IgxSwitchModule,
22-
IgxSliderModule,
23-
IgxCheckboxModule,
12+
NoopAnimationsModule,
2413
<%=ClassName%>,
2514
],
2615
teardown: { destroyAfterEach: false }

packages/igx-templates/igx-ts/custom-templates/fintech-tree-grid/files/src/app/__path__/__filePrefix__.spec.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
2-
import { FormsModule } from '@angular/forms';
3-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
2+
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
43
import { <%=ClassName%> } from './<%=filePrefix%>';
54
import { <%=ClassName%>TreeGridGroupingPipe } from './tree-grid-grouping.pipe';
6-
import { IgxTreeGridModule, IgxCheckboxModule, IgxButtonModule, IgxSliderModule, IgxSwitchModule } from '<%=igxPackage%>';
75

86
describe('<%=ClassName%>', () => {
97
let component: <%=ClassName%>;
@@ -12,13 +10,7 @@ describe('<%=ClassName%>', () => {
1210
beforeEach(async () => {
1311
await TestBed.configureTestingModule({
1412
imports: [
15-
FormsModule,
16-
BrowserAnimationsModule,
17-
IgxTreeGridModule,
18-
IgxCheckboxModule,
19-
IgxButtonModule,
20-
IgxSliderModule,
21-
IgxSwitchModule,
13+
NoopAnimationsModule,
2214
<%=ClassName%>,
2315
<%=ClassName%>TreeGridGroupingPipe
2416
]

packages/igx-templates/igx-ts/custom-templates/login/files/src/app/__path__/__filePrefix__.spec.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
2-
import { ReactiveFormsModule } from '@angular/forms';
3-
import { RouterTestingModule } from '@angular/router/testing';
42
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
53
import { <%=ClassName%> } from './<%=filePrefix%>';
6-
import { IgxInputGroupModule, IgxIconModule, IgxButtonModule, IgxRippleModule } from '<%=igxPackage%>';
74

85
const MAIL_GROUP_NAME = 'email';
96
const PASSWORD_GROUP_NAME = 'password';
@@ -19,15 +16,9 @@ describe('<%=ClassName%>', () => {
1916
beforeEach(async () => {
2017
await TestBed.configureTestingModule({
2118
imports: [
22-
ReactiveFormsModule,
23-
RouterTestingModule,
2419
NoopAnimationsModule,
25-
IgxInputGroupModule,
26-
IgxButtonModule,
27-
IgxIconModule,
28-
IgxRippleModule,
2920
<%=ClassName%>,
30-
]
21+
],
3122
})
3223
.compileComponents();
3324
});

packages/igx-templates/igx-ts/custom-templates/weather-forecast/files/src/app/__path__/__filePrefix__.spec.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
2-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
2+
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
33
import { <%=ClassName%> } from './<%=filePrefix%>';
4-
import {
5-
IgxButtonModule,
6-
IgxCardModule,
7-
IgxExpansionPanelModule,
8-
IgxIconModule
9-
} from '<%=igxPackage%>';
4+
105
describe('<%=ClassName%>', () => {
116
let component: <%=ClassName%>;
127
let fixture: ComponentFixture<<%=ClassName%>>;
138

149
beforeEach(async () => {
1510
await TestBed.configureTestingModule({
1611
imports: [
17-
BrowserAnimationsModule,
18-
IgxButtonModule,
19-
IgxCardModule,
20-
IgxExpansionPanelModule,
21-
IgxIconModule,
12+
NoopAnimationsModule,
2213
<%=ClassName%>
2314
]
2415
})

packages/igx-templates/igx-ts/dropdown/default/files/src/app/__path__/__filePrefix__.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
22
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
3-
import { IgxDropDownModule, IgxToggleModule } from '<%=igxPackage%>';
43
import { <%=ClassName%> } from './<%=filePrefix%>';
54

65
describe('<%=ClassName%>', () => {
@@ -9,7 +8,7 @@ describe('<%=ClassName%>', () => {
98

109
beforeEach(async () => {
1110
await TestBed.configureTestingModule({
12-
imports: [IgxDropDownModule, NoopAnimationsModule, IgxToggleModule, <%=ClassName%>]
11+
imports: [NoopAnimationsModule, <%=ClassName%>]
1312
})
1413
.compileComponents();
1514
});

packages/igx-templates/igx-ts/grid/grid-custom/files/src/app/__path__/__filePrefix__.spec.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
2-
import { FormsModule } from '@angular/forms';
3-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
4-
import { IgxCheckboxModule, IgxDatePickerModule, IgxGridModule } from '<%=igxPackage%>';
2+
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
3+
import { IgxGridModule } from '<%=igxPackage%>';
54
import { <%=ClassName%> } from './<%=filePrefix%>';
65

76
describe('<%=ClassName%>', () => {
@@ -10,7 +9,7 @@ describe('<%=ClassName%>', () => {
109

1110
beforeEach(async () => {
1211
await TestBed.configureTestingModule({
13-
imports: [FormsModule, BrowserAnimationsModule, IgxGridModule, IgxDatePickerModule, IgxCheckboxModule, <%=ClassName%>]
12+
imports: [NoopAnimationsModule, IgxGridModule, <%=ClassName%>]
1413
})
1514
.compileComponents();
1615
});

packages/igx-templates/igx-ts/grid/multi-column-headers/files/src/app/__path__/__filePrefix__.spec.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
2-
import { FormsModule } from '@angular/forms';
3-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
4-
import { IgxCheckboxModule, IgxDatePickerModule, IgxGridModule } from '<%=igxPackage%>';
2+
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
3+
import { IgxGridModule } from '<%=igxPackage%>';
54
import { <%=ClassName%> } from './<%=filePrefix%>';
65

76
describe('<%=ClassName%>', () => {
@@ -10,7 +9,7 @@ describe('<%=ClassName%>', () => {
109

1110
beforeEach(async () => {
1211
await TestBed.configureTestingModule({
13-
imports: [FormsModule, BrowserAnimationsModule, IgxGridModule, IgxDatePickerModule, IgxCheckboxModule, <%=ClassName%>]
12+
imports: [NoopAnimationsModule, IgxGridModule, <%=ClassName%>]
1413
})
1514
.compileComponents();
1615
});

packages/igx-templates/igx-ts/hierarchical-grid/hierarchical-grid-batch-editing/files/src/app/__path__/__filePrefix__.spec.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
2-
import { FormsModule } from '@angular/forms';
32
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
4-
import {
5-
IgxGridModule, IgxDatePickerModule, IgxCheckboxModule, IgxDialogModule, IgxHierarchicalGridModule
6-
} from '<%=igxPackage%>';
73
import { <%=ClassName%> } from './<%=filePrefix%>';
84

95
describe('<%=ClassName%>', () => {
@@ -13,13 +9,7 @@ describe('<%=ClassName%>', () => {
139
beforeEach(async () => {
1410
await TestBed.configureTestingModule({
1511
imports: [
16-
FormsModule,
1712
NoopAnimationsModule,
18-
IgxGridModule,
19-
IgxHierarchicalGridModule,
20-
IgxDatePickerModule,
21-
IgxCheckboxModule,
22-
IgxDialogModule,
2313
<%=ClassName%>
2414
]
2515
})

0 commit comments

Comments
 (0)