From 6cb27e5f3f5c9d6c1ea3c3f790b6addfc5af57a4 Mon Sep 17 00:00:00 2001 From: crisbeto Date: Wed, 6 Nov 2019 08:08:09 +0900 Subject: [PATCH] test: fix a couple of shared harness functions ignoring module parameter Fixes the shared test functions for the dialog and progress spinner harnesses ignoring their `module` parameter and always using the Material module. --- src/material/dialog/testing/shared.spec.ts | 4 ++-- src/material/progress-spinner/testing/shared.spec.ts | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/material/dialog/testing/shared.spec.ts b/src/material/dialog/testing/shared.spec.ts index 7bfb7f41e187..949c90b71826 100644 --- a/src/material/dialog/testing/shared.spec.ts +++ b/src/material/dialog/testing/shared.spec.ts @@ -7,7 +7,7 @@ import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {OverlayContainer} from '@angular/cdk/overlay'; import {MatDialogHarness} from './dialog-harness'; -/** Shared tests to run on both the original and MDC-based radio-button's. */ +/** Shared tests to run on both the original and MDC-based dialog's. */ export function runHarnessTests( dialogModule: typeof MatDialogModule, dialogHarness: typeof MatDialogHarness) { let fixture: ComponentFixture; @@ -17,7 +17,7 @@ export function runHarnessTests( beforeEach(async () => { await TestBed .configureTestingModule({ - imports: [MatDialogModule, NoopAnimationsModule], + imports: [dialogModule, NoopAnimationsModule], declarations: [DialogHarnessTest], }) .compileComponents(); diff --git a/src/material/progress-spinner/testing/shared.spec.ts b/src/material/progress-spinner/testing/shared.spec.ts index 0ceebdc25d6a..d01d70bd6532 100644 --- a/src/material/progress-spinner/testing/shared.spec.ts +++ b/src/material/progress-spinner/testing/shared.spec.ts @@ -2,9 +2,10 @@ import {HarnessLoader} from '@angular/cdk/testing'; import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; import {Component} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {MatProgressSpinnerModule, ProgressSpinnerMode} from '@angular/material/progress-spinner'; +import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; import {MatProgressSpinnerHarness} from './progress-spinner-harness'; +/** Runs the shared unit tests for the progress spinner test harness. */ export function runHarnessTests(progressSpinnerModule: typeof MatProgressSpinnerModule, progressSpinnerHarness: typeof MatProgressSpinnerHarness) { let fixture: ComponentFixture; @@ -13,7 +14,7 @@ export function runHarnessTests(progressSpinnerModule: typeof MatProgressSpinner beforeEach(async () => { await TestBed .configureTestingModule({ - imports: [MatProgressSpinnerModule], + imports: [progressSpinnerModule], declarations: [ProgressSpinnerHarnessTest], }) .compileComponents(); @@ -37,8 +38,8 @@ export function runHarnessTests(progressSpinnerModule: typeof MatProgressSpinner it('should get the mode', async () => { const [determinate, indeterminate] = await loader.getAllHarnesses(progressSpinnerHarness); - expect(await determinate.getMode()).toBe('determinate'); - expect(await indeterminate.getMode()).toBe('indeterminate'); + expect(await determinate.getMode()).toBe('determinate'); + expect(await indeterminate.getMode()).toBe('indeterminate'); }); }