Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
845e4b4
test(cdk/a11y): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
ed90eef
test(cdk/clipboard): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
d332a79
test(cdk/menu): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
54f0b8e
test(cdk/observers): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
3c7de96
test(cdk/scrolling): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
821cd6e
test(cdk/table): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
87eb6d0
test(cdk/text-field): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
d66aae0
test(material/grid-list): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
4feaaa5
test(material/icon): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
cfcb404
test(material/slider): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
0f85add
test(material/badge): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
4817eef
test(material/bottom-sheet): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
b3fd3fa
test(material/button): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
8b1670c
test(material/button-toggle): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
86bb118
test(material/card): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
adb2fe8
test(material/checkbox): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
24cad5d
test(material/chips): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
cc95fbc
test(material/core): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
dcaf206
test(material/datepicker): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
04e287a
test(material/dialog): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
41f9e02
test(material/divider): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
407f7dc
test(material/expansion): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
30c29c1
test(material/form-field): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
5fc102b
test(material/menu): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
2336c8b
test(material/list): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
55577cf
test(material/progress-bar): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
7be9eaf
test(material/progress-spinner): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
348868c
test(material/radio): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
c898bf2
test(material/sidenav): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
274a099
test(material/slide-toggle): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
b4e1d83
test(material/snack-bar): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
09495da
test(material/sort): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
cb5a90d
test(material/table): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
d0d068a
test(material/tabs): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
62b588c
test(material/toolbar): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
782187f
test(material/tooltip): clean up unnecessary imports in tests
crisbeto Aug 22, 2025
2e84514
test(material/tree): clean up unnecessary imports in tests
crisbeto Aug 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/cdk/a11y/aria-describer/aria-describer.spec.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import {A11yModule, CDK_DESCRIBEDBY_HOST_ATTRIBUTE} from '../index';
import {AriaDescriber} from './aria-describer';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {Component, ElementRef, ViewChild, Provider, inject} from '@angular/core';
import {Component, ElementRef, ViewChild, inject} from '@angular/core';

describe('AriaDescriber', () => {
let ariaDescriber: AriaDescriber;
let component: TestApp;
let fixture: ComponentFixture<TestApp>;

function createFixture(providers: Provider[] = []) {
TestBed.configureTestingModule({
providers: [AriaDescriber, ...providers],
});

function createFixture() {
fixture = TestBed.createComponent(TestApp);
component = fixture.componentInstance;
ariaDescriber = component.ariaDescriber;
Expand Down
2 changes: 0 additions & 2 deletions src/cdk/clipboard/clipboard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ describe('Clipboard', () => {
let focusedInput: HTMLElement;

beforeEach(() => {
TestBed.configureTestingModule({});

clipboard = TestBed.inject(Clipboard);
document = TestBed.inject(DOCUMENT);
execCommand = spyOn(document, 'execCommand').and.returnValue(true);
Expand Down
6 changes: 0 additions & 6 deletions src/cdk/menu/menu-bar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ describe('MenuBar', () => {
let menuItems: CdkMenuItemRadio[];

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({});

fixture = TestBed.createComponent(MenuBarRadioGroup);
fixture.detectChanges();

Expand Down Expand Up @@ -102,10 +100,6 @@ describe('MenuBar', () => {
detectChanges();
}

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({});
}));

beforeEach(() => {
fixture = TestBed.createComponent(MultiMenuWithSubmenu);
detectChanges();
Expand Down
2 changes: 0 additions & 2 deletions src/cdk/observers/observe-content.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,6 @@ describe('ContentObserver injectable', () => {
let contentObserver: ContentObserver;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({});

const fixture = TestBed.createComponent(UnobservedComponentWithTextContent);
fixture.autoDetectChanges();
spy = jasmine.createSpy('content observer');
Expand Down
10 changes: 3 additions & 7 deletions src/cdk/scrolling/scroll-dispatcher.spec.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import {TestBed, waitForAsync, fakeAsync, ComponentFixture, tick} from '@angular/core/testing';
import {TestBed, fakeAsync, ComponentFixture, tick} from '@angular/core/testing';
import {Component, ViewChild, ElementRef} from '@angular/core';
import {CdkScrollable, ScrollDispatcher, ScrollingModule} from './public-api';
import {dispatchFakeEvent} from '../testing/private';

describe('ScrollDispatcher', () => {
let scroll: ScrollDispatcher;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [ScrollingModule, ScrollingComponent, NestedScrollingComponent],
});

beforeEach(() => {
scroll = TestBed.inject(ScrollDispatcher);
}));
});

describe('Basic usage', () => {
let fixture: ComponentFixture<ScrollingComponent>;
Expand Down
7 changes: 3 additions & 4 deletions src/cdk/scrolling/scroll-dispatcher.zone.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, ElementRef, ViewChild, provideZoneChangeDetection} from '@angular/core';
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {dispatchFakeEvent} from '../testing/private';
import {ScrollDispatcher} from './scroll-dispatcher';
import {CdkScrollable} from './scrollable';
Expand All @@ -9,16 +9,15 @@ describe('ScrollDispatcher Zone.js integration', () => {
let scroll: ScrollDispatcher;
let fixture: ComponentFixture<ScrollingComponent>;

beforeEach(waitForAsync(() => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [ScrollingModule, ScrollingComponent],
providers: [provideZoneChangeDetection()],
});

scroll = TestBed.inject(ScrollDispatcher);
fixture = TestBed.createComponent(ScrollingComponent);
fixture.detectChanges();
}));
});

it('should not execute the global events in the Angular zone', () => {
scroll.scrolled(0).subscribe(() => {});
Expand Down
8 changes: 1 addition & 7 deletions src/cdk/scrolling/scrollable.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Direction} from '../bidi';
import {CdkScrollable, ScrollingModule} from '../scrolling';
import {Component, ElementRef, Input, ViewChild} from '@angular/core';
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
import {ComponentFixture, TestBed} from '@angular/core/testing';

function expectOverlapping(el1: ElementRef<Element>, el2: ElementRef<Element>, expected = true) {
const r1 = el1.nativeElement.getBoundingClientRect();
Expand All @@ -24,12 +24,6 @@ describe('CdkScrollable', () => {
let testComponent: ScrollableViewport;
let maxOffset = 0;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [ScrollingModule, ScrollableViewport],
});
}));

beforeEach(() => {
fixture = TestBed.createComponent(ScrollableViewport);
fixture.detectChanges();
Expand Down
50 changes: 1 addition & 49 deletions src/cdk/scrolling/virtual-scroll-viewport.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ describe('CdkVirtualScrollViewport', () => {
let testComponent: FixedSizeVirtualScroll;
let viewport: CdkVirtualScrollViewport;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [ScrollingModule, FixedSizeVirtualScroll],
});
}));

beforeEach(() => {
fixture = TestBed.createComponent(FixedSizeVirtualScroll);
testComponent = fixture.componentInstance;
Expand Down Expand Up @@ -836,10 +830,6 @@ describe('CdkVirtualScrollViewport', () => {
let contentWrapperEl: HTMLElement;

beforeEach(() => {
TestBed.configureTestingModule({
imports: [ScrollingModule, FixedSizeVirtualScrollWithRtlDirection],
});

fixture = TestBed.createComponent(FixedSizeVirtualScrollWithRtlDirection);
testComponent = fixture.componentInstance;
viewport = testComponent.viewport;
Expand Down Expand Up @@ -935,12 +925,6 @@ describe('CdkVirtualScrollViewport', () => {
});

describe('with no VirtualScrollStrategy', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [ScrollingModule, VirtualScrollWithNoStrategy],
});
});

it('should fail on construction', fakeAsync(() => {
expect(() => TestBed.createComponent(VirtualScrollWithNoStrategy)).toThrowError(
'Error: cdk-virtual-scroll-viewport requires the "itemSize" property to be set.',
Expand All @@ -953,16 +937,6 @@ describe('CdkVirtualScrollViewport', () => {
let testComponent: VirtualScrollWithItemInjectingViewContainer;
let viewport: CdkVirtualScrollViewport;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
ScrollingModule,
VirtualScrollWithItemInjectingViewContainer,
InjectsViewContainer,
],
});
}));

beforeEach(() => {
fixture = TestBed.createComponent(VirtualScrollWithItemInjectingViewContainer);
testComponent = fixture.componentInstance;
Expand Down Expand Up @@ -992,9 +966,6 @@ describe('CdkVirtualScrollViewport', () => {
let viewport: CdkVirtualScrollViewport;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [ScrollingModule, DelayedInitializationVirtualScroll],
});
fixture = TestBed.createComponent(DelayedInitializationVirtualScroll);
testComponent = fixture.componentInstance;
viewport = testComponent.viewport;
Expand Down Expand Up @@ -1022,9 +993,6 @@ describe('CdkVirtualScrollViewport', () => {
let contentWrapperEl: HTMLElement;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [ScrollingModule, VirtualScrollWithAppendOnly],
});
fixture = TestBed.createComponent(VirtualScrollWithAppendOnly);
testComponent = fixture.componentInstance;
viewport = testComponent.viewport;
Expand Down Expand Up @@ -1098,12 +1066,6 @@ describe('CdkVirtualScrollViewport', () => {
let testComponent: VirtualScrollWithCustomScrollingElement;
let viewport: CdkVirtualScrollViewport;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [ScrollingModule, VirtualScrollWithCustomScrollingElement],
});
}));

beforeEach(() => {
fixture = TestBed.createComponent(VirtualScrollWithCustomScrollingElement);
testComponent = fixture.componentInstance;
Expand Down Expand Up @@ -1135,12 +1097,6 @@ describe('CdkVirtualScrollViewport', () => {
let testComponent: VirtualScrollWithScrollableWindow;
let viewport: CdkVirtualScrollViewport;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [ScrollingModule, VirtualScrollWithScrollableWindow],
});
}));

beforeEach(() => {
fixture = TestBed.createComponent(VirtualScrollWithScrollableWindow);
testComponent = fixture.componentInstance;
Expand All @@ -1162,10 +1118,6 @@ describe('CdkVirtualScrollViewport', () => {
});

it('should be able to query for a virtual scroll viewport as a CdkScrollable', () => {
TestBed.configureTestingModule({
imports: [ScrollingModule, VirtualScrollableQuery],
});

const fixture = TestBed.createComponent(VirtualScrollableQuery);
fixture.detectChanges();

Expand Down Expand Up @@ -1385,7 +1337,7 @@ class InjectsViewContainer {
}
`,
encapsulation: ViewEncapsulation.None,
imports: [ScrollingModule],
imports: [InjectsViewContainer, ScrollingModule],
})
class VirtualScrollWithItemInjectingViewContainer {
@ViewChild(CdkVirtualScrollViewport, {static: true}) viewport: CdkVirtualScrollViewport;
Expand Down
7 changes: 3 additions & 4 deletions src/cdk/scrolling/virtual-scroll-viewport.zone.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
afterNextRender,
provideZoneChangeDetection,
} from '@angular/core';
import {ComponentFixture, TestBed, fakeAsync, flush, waitForAsync} from '@angular/core/testing';
import {ComponentFixture, TestBed, fakeAsync, flush} from '@angular/core/testing';
import {animationFrameScheduler} from 'rxjs';
import {dispatchFakeEvent} from '../testing/private';
import {ScrollingModule} from './scrolling-module';
Expand All @@ -21,16 +21,15 @@ describe('CdkVirtualScrollViewport Zone.js intergation', () => {
let testComponent: FixedSizeVirtualScroll;
let viewport: CdkVirtualScrollViewport;

beforeEach(waitForAsync(() => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [provideZoneChangeDetection()],
imports: [ScrollingModule, FixedSizeVirtualScroll],
});

fixture = TestBed.createComponent(FixedSizeVirtualScroll);
testComponent = fixture.componentInstance;
viewport = testComponent.viewport;
}));
});

it('should emit on viewChange inside the Angular zone', fakeAsync(() => {
const zoneTest = jasmine.createSpy('zone test');
Expand Down
9 changes: 1 addition & 8 deletions src/cdk/table/text-column.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component} from '@angular/core';
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
import {ComponentFixture, TestBed} from '@angular/core/testing';

import {
getTableTextColumnMissingNameError,
Expand All @@ -14,12 +14,6 @@ describe('CdkTextColumn', () => {
let component: BasicTextColumnApp;
let tableElement: HTMLElement;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [CdkTableModule, BasicTextColumnApp, MissingTableApp, TextColumnWithoutNameApp],
});
}));

beforeEach(() => {
fixture = TestBed.createComponent(BasicTextColumnApp);
component = fixture.componentInstance;
Expand Down Expand Up @@ -105,7 +99,6 @@ describe('CdkTextColumn', () => {
// The testing module has been initialized in the root describe group for the ripples.
TestBed.resetTestingModule();
TestBed.configureTestingModule({
imports: [CdkTableModule, BasicTextColumnApp],
providers: [{provide: TEXT_COLUMN_OPTIONS, useValue: options}],
});

Expand Down
31 changes: 1 addition & 30 deletions src/cdk/text-field/autosize.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import {Component, ViewChild} from '@angular/core';
import {
ComponentFixture,
TestBed,
fakeAsync,
flush,
tick,
waitForAsync,
} from '@angular/core/testing';
import {ComponentFixture, TestBed, fakeAsync, flush, tick} from '@angular/core/testing';
import {FormsModule} from '@angular/forms';
import {By} from '@angular/platform-browser';
import {dispatchFakeEvent} from '../testing/private';
Expand All @@ -18,19 +11,6 @@ describe('CdkTextareaAutosize', () => {
let textarea: HTMLTextAreaElement;
let autosize: CdkTextareaAutosize;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
FormsModule,
TextFieldModule,
AutosizeTextAreaWithContent,
AutosizeTextAreaWithValue,
AutosizeTextareaWithNgModel,
AutosizeTextareaWithoutAutosize,
],
});
}));

beforeEach(() => {
fixture = TestBed.createComponent(AutosizeTextAreaWithContent);
fixture.detectChanges();
Expand Down Expand Up @@ -417,15 +397,6 @@ class AutosizeTextAreaWithContent {
placeholder: string = '';
}

@Component({
template: `<textarea cdkTextareaAutosize [value]="value"></textarea>`,
styles: textareaStyleReset,
imports: [FormsModule, TextFieldModule],
})
class AutosizeTextAreaWithValue {
value: string = '';
}

@Component({
template: `<textarea cdkTextareaAutosize [(ngModel)]="model"></textarea>`,
styles: textareaStyleReset,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@ import {ComponentFixture, TestBed} from '@angular/core/testing';
import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed';
import {MatGridListHarness, MatGridTileHarness} from '@angular/material/grid-list/testing';
import {HarnessLoader} from '@angular/cdk/testing';
import {MatGridListModule} from '@angular/material/grid-list';
import {GridListHarnessExample} from './grid-list-harness-example';

describe('GridListHarnessExample', () => {
let fixture: ComponentFixture<GridListHarnessExample>;
let loader: HarnessLoader;

beforeEach(() => {
TestBed.configureTestingModule({
imports: [MatGridListModule, GridListHarnessExample],
});
fixture = TestBed.createComponent(GridListHarnessExample);
fixture.detectChanges();
loader = TestbedHarnessEnvironment.loader(fixture);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {ComponentFixture, TestBed} from '@angular/core/testing';
import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed';
import {HarnessLoader, parallel} from '@angular/cdk/testing';
import {IconHarnessExample} from './icon-harness-example';
import {MatIconModule, MatIconRegistry} from '@angular/material/icon';
import {MatIconRegistry} from '@angular/material/icon';
import {MatIconHarness} from '@angular/material/icon/testing';
import {DomSanitizer} from '@angular/platform-browser';

Expand All @@ -11,9 +11,6 @@ describe('IconHarnessExample', () => {
let loader: HarnessLoader;

beforeEach(() => {
TestBed.configureTestingModule({
imports: [MatIconModule],
});
const registry = TestBed.inject(MatIconRegistry);
const sanitizer = TestBed.inject(DomSanitizer);

Expand Down
Loading
Loading