Skip to content

Commit 69ccd34

Browse files
crisbetommalerba
authored andcommitted
test: fix a couple of shared harness functions ignoring module parameter (#17617)
Fixes the shared test functions for the dialog and progress spinner harnesses ignoring their `module` parameter and always using the Material module.
1 parent 7cd314c commit 69ccd34

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/material/dialog/testing/shared.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {NoopAnimationsModule} from '@angular/platform-browser/animations';
77
import {OverlayContainer} from '@angular/cdk/overlay';
88
import {MatDialogHarness} from './dialog-harness';
99

10-
/** Shared tests to run on both the original and MDC-based radio-button's. */
10+
/** Shared tests to run on both the original and MDC-based dialog's. */
1111
export function runHarnessTests(
1212
dialogModule: typeof MatDialogModule, dialogHarness: typeof MatDialogHarness) {
1313
let fixture: ComponentFixture<DialogHarnessTest>;
@@ -17,7 +17,7 @@ export function runHarnessTests(
1717
beforeEach(async () => {
1818
await TestBed
1919
.configureTestingModule({
20-
imports: [MatDialogModule, NoopAnimationsModule],
20+
imports: [dialogModule, NoopAnimationsModule],
2121
declarations: [DialogHarnessTest],
2222
})
2323
.compileComponents();

src/material/progress-spinner/testing/shared.spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import {HarnessLoader} from '@angular/cdk/testing';
22
import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed';
33
import {Component} from '@angular/core';
44
import {ComponentFixture, TestBed} from '@angular/core/testing';
5-
import {MatProgressSpinnerModule, ProgressSpinnerMode} from '@angular/material/progress-spinner';
5+
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
66
import {MatProgressSpinnerHarness} from './progress-spinner-harness';
77

8+
/** Runs the shared unit tests for the progress spinner test harness. */
89
export function runHarnessTests(progressSpinnerModule: typeof MatProgressSpinnerModule,
910
progressSpinnerHarness: typeof MatProgressSpinnerHarness) {
1011
let fixture: ComponentFixture<ProgressSpinnerHarnessTest>;
@@ -13,7 +14,7 @@ export function runHarnessTests(progressSpinnerModule: typeof MatProgressSpinner
1314
beforeEach(async () => {
1415
await TestBed
1516
.configureTestingModule({
16-
imports: [MatProgressSpinnerModule],
17+
imports: [progressSpinnerModule],
1718
declarations: [ProgressSpinnerHarnessTest],
1819
})
1920
.compileComponents();
@@ -37,8 +38,8 @@ export function runHarnessTests(progressSpinnerModule: typeof MatProgressSpinner
3738

3839
it('should get the mode', async () => {
3940
const [determinate, indeterminate] = await loader.getAllHarnesses(progressSpinnerHarness);
40-
expect<ProgressSpinnerMode>(await determinate.getMode()).toBe('determinate');
41-
expect<ProgressSpinnerMode>(await indeterminate.getMode()).toBe('indeterminate');
41+
expect(await determinate.getMode()).toBe('determinate');
42+
expect(await indeterminate.getMode()).toBe('indeterminate');
4243
});
4344
}
4445

0 commit comments

Comments
 (0)