Skip to content

test: fix a couple of shared harness functions ignoring module parameter #17617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions src/material/dialog/testing/shared.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<DialogHarnessTest>;
Expand All @@ -17,7 +17,7 @@ export function runHarnessTests(
beforeEach(async () => {
await TestBed
.configureTestingModule({
imports: [MatDialogModule, NoopAnimationsModule],
imports: [dialogModule, NoopAnimationsModule],
declarations: [DialogHarnessTest],
})
.compileComponents();
Expand Down
9 changes: 5 additions & 4 deletions src/material/progress-spinner/testing/shared.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<ProgressSpinnerHarnessTest>;
Expand All @@ -13,7 +14,7 @@ export function runHarnessTests(progressSpinnerModule: typeof MatProgressSpinner
beforeEach(async () => {
await TestBed
.configureTestingModule({
imports: [MatProgressSpinnerModule],
imports: [progressSpinnerModule],
declarations: [ProgressSpinnerHarnessTest],
})
.compileComponents();
Expand All @@ -37,8 +38,8 @@ export function runHarnessTests(progressSpinnerModule: typeof MatProgressSpinner

it('should get the mode', async () => {
const [determinate, indeterminate] = await loader.getAllHarnesses(progressSpinnerHarness);
expect<ProgressSpinnerMode>(await determinate.getMode()).toBe('determinate');
expect<ProgressSpinnerMode>(await indeterminate.getMode()).toBe('indeterminate');
expect(await determinate.getMode()).toBe('determinate');
expect(await indeterminate.getMode()).toBe('indeterminate');
});
}

Expand Down