forked from angular/components
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(material-experimental/mdc-progress-spinner): fix noop animation (a…
- Loading branch information
1 parent
6d36942
commit b34e0df
Showing
6 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...nts-examples/material/progress-bar/progress-bar-harness/progress-bar-harness-example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<mat-progress-bar mode="determinate" [value]="value"></mat-progress-bar> | ||
<mat-progress-bar mode="indeterminate"></mat-progress-bar> |
47 changes: 47 additions & 0 deletions
47
...-examples/material/progress-bar/progress-bar-harness/progress-bar-harness-example.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import {TestBed, ComponentFixture, waitForAsync} from '@angular/core/testing'; | ||
import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; | ||
import {MatProgressBarHarness} from '@angular/material/progress-bar/testing'; | ||
import {HarnessLoader} from '@angular/cdk/testing'; | ||
import {BrowserDynamicTestingModule, platformBrowserDynamicTesting} | ||
from '@angular/platform-browser-dynamic/testing'; | ||
import {MatProgressBarModule} from '@angular/material/progress-bar'; | ||
import {ProgressBarHarnessExample} from './progress-bar-harness-example'; | ||
|
||
describe('ProgressBarHarnessExample', () => { | ||
let fixture: ComponentFixture<ProgressBarHarnessExample>; | ||
let loader: HarnessLoader; | ||
|
||
beforeAll(() => { | ||
TestBed.initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting()); | ||
}); | ||
|
||
beforeEach( | ||
waitForAsync(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [MatProgressBarModule], | ||
declarations: [ProgressBarHarnessExample] | ||
}).compileComponents(); | ||
fixture = TestBed.createComponent(ProgressBarHarnessExample); | ||
fixture.detectChanges(); | ||
loader = TestbedHarnessEnvironment.loader(fixture); | ||
}) | ||
); | ||
|
||
it('should load all progress bar harnesses', async () => { | ||
const progressBars = await loader.getAllHarnesses(MatProgressBarHarness); | ||
expect(progressBars.length).toBe(2); | ||
}); | ||
|
||
it('should get the value', async () => { | ||
fixture.componentInstance.value = 50; | ||
const [determinate, indeterminate] = await loader.getAllHarnesses(MatProgressBarHarness); | ||
expect(await determinate.getValue()).toBe(50); | ||
expect(await indeterminate.getValue()).toBe(null); | ||
}); | ||
|
||
it('should get the mode', async () => { | ||
const [determinate, indeterminate] = await loader.getAllHarnesses(MatProgressBarHarness); | ||
expect(await determinate.getMode()).toBe('determinate'); | ||
expect(await indeterminate.getMode()).toBe('indeterminate'); | ||
}); | ||
}); |
13 changes: 13 additions & 0 deletions
13
...nents-examples/material/progress-bar/progress-bar-harness/progress-bar-harness-example.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {Component} from '@angular/core'; | ||
|
||
/** | ||
* @title Testing with MatProgressBarHarness | ||
*/ | ||
@Component({ | ||
selector: 'progress-bar-harness-example', | ||
templateUrl: 'progress-bar-harness-example.html' | ||
}) | ||
export class ProgressBarHarnessExample { | ||
value: number; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters