Skip to content

Commit f3baa6a

Browse files
committed
test(material/tabs): clean up unnecessary imports in tests
Removes imports from tests that aren't necessary anymore, because we're using standalone.
1 parent 7a6b72b commit f3baa6a

File tree

4 files changed

+4
-72
lines changed

4 files changed

+4
-72
lines changed

src/material/tabs/tab-body.spec.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,14 @@ import {
1515
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
1616
import {By} from '@angular/platform-browser';
1717
import {MatRippleModule} from '../core';
18-
import {MatTabBody, MatTabBodyPortal} from './tab-body';
18+
import {MatTabBody} from './tab-body';
1919

2020
describe('MatTabBody', () => {
2121
let dir: WritableSignal<Direction>;
2222

2323
beforeEach(waitForAsync(() => {
2424
dir = signal('ltr');
25-
TestBed.configureTestingModule({
26-
imports: [PortalModule, MatRippleModule, MatTabBody, MatTabBodyPortal, SimpleTabBodyApp],
27-
providers: [provideFakeDirectionality(dir)],
28-
});
25+
TestBed.configureTestingModule({providers: [provideFakeDirectionality(dir)]});
2926
}));
3027

3128
it('should be center position if origin is unchanged', () => {

src/material/tabs/tab-group.spec.ts

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,6 @@ import {MATERIAL_ANIMATIONS} from '../core';
2525
describe('MatTabGroup', () => {
2626
beforeEach(fakeAsync(() => {
2727
TestBed.configureTestingModule({
28-
imports: [
29-
MatTabsModule,
30-
SimpleTabsTestApp,
31-
SimpleDynamicTabsTestApp,
32-
BindedTabsTestApp,
33-
AsyncTabsTestApp,
34-
DisabledTabsTestApp,
35-
TabGroupWithSimpleApi,
36-
TemplateTabs,
37-
TabGroupWithAriaInputs,
38-
TabGroupWithIsActiveBinding,
39-
NestedTabs,
40-
TabGroupWithIndirectDescendantTabs,
41-
TabGroupWithSpaceAbove,
42-
NestedTabGroupWithLabel,
43-
TabsWithClassesTestApp,
44-
],
4528
providers: [{provide: MATERIAL_ANIMATIONS, useValue: {animationsDisabled: true}}],
4629
});
4730
}));
@@ -1057,12 +1040,6 @@ describe('MatTabGroup', () => {
10571040
});
10581041

10591042
describe('nested MatTabGroup with enabled animations', () => {
1060-
beforeEach(fakeAsync(() => {
1061-
TestBed.configureTestingModule({
1062-
imports: [MatTabsModule, NestedTabs, TabsWithCustomAnimationDuration],
1063-
});
1064-
}));
1065-
10661043
it('should not throw when creating a component with nested tab groups', fakeAsync(() => {
10671044
expect(() => {
10681045
let fixture = TestBed.createComponent(NestedTabs);
@@ -1092,12 +1069,6 @@ describe('nested MatTabGroup with enabled animations', () => {
10921069
describe('MatTabGroup with ink bar fit to content', () => {
10931070
let fixture: ComponentFixture<TabGroupWithInkBarFitToContent>;
10941071

1095-
beforeEach(fakeAsync(() => {
1096-
TestBed.configureTestingModule({
1097-
imports: [MatTabsModule, TabGroupWithInkBarFitToContent],
1098-
});
1099-
}));
1100-
11011072
beforeEach(() => {
11021073
fixture = TestBed.createComponent(TabGroupWithInkBarFitToContent);
11031074
fixture.detectChanges();
@@ -1136,7 +1107,6 @@ describe('MatTabNavBar with a default config', () => {
11361107

11371108
beforeEach(fakeAsync(() => {
11381109
TestBed.configureTestingModule({
1139-
imports: [MatTabsModule, SimpleTabsTestApp],
11401110
providers: [
11411111
{
11421112
provide: MAT_TABS_CONFIG,
@@ -1167,7 +1137,6 @@ describe('MatTabNavBar with a default config', () => {
11671137
describe('MatTabGroup labels aligned with a config', () => {
11681138
it('should work with start align', () => {
11691139
const fixture = TestBed.configureTestingModule({
1170-
imports: [MatTabsModule, TabsWithAlignConfig],
11711140
providers: [
11721141
{
11731142
provide: MAT_TABS_CONFIG,
@@ -1183,7 +1152,6 @@ describe('MatTabGroup labels aligned with a config', () => {
11831152

11841153
it('should work with center align', () => {
11851154
const fixture = TestBed.configureTestingModule({
1186-
imports: [MatTabsModule, TabsWithAlignConfig],
11871155
providers: [
11881156
{
11891157
provide: MAT_TABS_CONFIG,
@@ -1199,7 +1167,6 @@ describe('MatTabGroup labels aligned with a config', () => {
11991167

12001168
it('should work with end align', () => {
12011169
const fixture = TestBed.configureTestingModule({
1202-
imports: [MatTabsModule, TabsWithAlignConfig],
12031170
providers: [
12041171
{
12051172
provide: MAT_TABS_CONFIG,
@@ -1214,9 +1181,7 @@ describe('MatTabGroup labels aligned with a config', () => {
12141181
});
12151182

12161183
it('should not add align if default config doesnt set align', () => {
1217-
const fixture = TestBed.configureTestingModule({
1218-
imports: [MatTabsModule, TabsWithAlignConfig],
1219-
}).createComponent(TabsWithAlignConfig);
1184+
const fixture = TestBed.createComponent(TabsWithAlignConfig);
12201185
fixture.detectChanges();
12211186

12221187
let tabElement = fixture.nativeElement.querySelector('[mat-align-tabs="start"]');
@@ -1234,7 +1199,6 @@ describe('MatTabGroup labels aligned with a config', () => {
12341199

12351200
it('should not break if config sets align on already aligned tabs', () => {
12361201
const fixture = TestBed.configureTestingModule({
1237-
imports: [MatTabsModule, TabsWithAlignCenter],
12381202
providers: [{provide: MAT_TABS_CONFIG, useValue: {alignTabs: 'end'}}],
12391203
}).createComponent(TabsWithAlignCenter);
12401204
fixture.detectChanges();

src/material/tabs/tab-header.spec.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import {Dir, Direction} from '@angular/cdk/bidi';
22
import {END, ENTER, HOME, LEFT_ARROW, RIGHT_ARROW, SPACE} from '@angular/cdk/keycodes';
3-
import {MutationObserverFactory, ObserversModule} from '@angular/cdk/observers';
3+
import {MutationObserverFactory} from '@angular/cdk/observers';
44
import {SharedResizeObserver} from '@angular/cdk/observers/private';
5-
import {PortalModule} from '@angular/cdk/portal';
6-
import {ScrollingModule, ViewportRuler} from '@angular/cdk/scrolling';
75
import {
86
createKeyboardEvent,
97
createMouseEvent,
@@ -22,7 +20,6 @@ import {
2220
tick,
2321
waitForAsync,
2422
} from '@angular/core/testing';
25-
import {MatRippleModule} from '../core';
2623
import {By} from '@angular/platform-browser';
2724
import {Subject} from 'rxjs';
2825
import {MatTabHeader} from './tab-header';
@@ -34,19 +31,6 @@ describe('MatTabHeader', () => {
3431
let resizeEvents: Subject<ResizeObserverEntry[]>;
3532

3633
beforeEach(waitForAsync(() => {
37-
TestBed.configureTestingModule({
38-
imports: [
39-
PortalModule,
40-
MatRippleModule,
41-
ScrollingModule,
42-
ObserversModule,
43-
MatTabHeader,
44-
MatTabLabelWrapper,
45-
SimpleTabHeaderApp,
46-
],
47-
providers: [ViewportRuler],
48-
});
49-
5034
resizeEvents = new Subject();
5135
spyOn(TestBed.inject(SharedResizeObserver), 'observe').and.returnValue(resizeEvents);
5236
}));

src/material/tabs/tab-nav-bar/tab-nav-bar.spec.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ describe('MatTabNavBar', () => {
2626
dir = signal('ltr');
2727

2828
TestBed.configureTestingModule({
29-
imports: [
30-
MatTabsModule,
31-
SimpleTabNavBarTestApp,
32-
TabLinkWithNgIf,
33-
TabBarWithInactiveTabsOnInit,
34-
],
3529
providers: [
3630
{provide: MAT_RIPPLE_GLOBAL_OPTIONS, useFactory: () => globalRippleOptions},
3731
provideFakeDirectionality(dir),
@@ -503,7 +497,6 @@ describe('MatTabNavBar with a default config', () => {
503497

504498
beforeEach(fakeAsync(() => {
505499
TestBed.configureTestingModule({
506-
imports: [MatTabsModule, TabLinkWithNgIf],
507500
providers: [{provide: MAT_TABS_CONFIG, useValue: {fitInkBarToContent: true}}],
508501
});
509502
}));
@@ -523,12 +516,6 @@ describe('MatTabNavBar with a default config', () => {
523516
});
524517

525518
describe('MatTabNavBar with enabled animations', () => {
526-
beforeEach(fakeAsync(() => {
527-
TestBed.configureTestingModule({
528-
imports: [MatTabsModule, TabsWithCustomAnimationDuration],
529-
});
530-
}));
531-
532519
it('should not throw when setting an animationDuration without units', fakeAsync(() => {
533520
expect(() => {
534521
let fixture = TestBed.createComponent(TabsWithCustomAnimationDuration);

0 commit comments

Comments
 (0)