Skip to content

Commit c1709bb

Browse files
committed
chore: remove FakeViewportRuler
Now that all tests have been moved away from the `FakeViewportRuler`, we can safely get rid of it. In general we should avoid stubbing out the window dimensions, because it can be unreliable and it doesn't work well when something is positioned using `bottom` and `right`.
1 parent 60b0625 commit c1709bb

File tree

5 files changed

+1
-35
lines changed

5 files changed

+1
-35
lines changed

src/cdk/testing/fake-viewport-ruler.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/cdk/testing/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
10-
119
export * from './public-api';

src/cdk/testing/public-api.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ export * from './dispatch-events';
1010
export * from './event-objects';
1111
export * from './type-in-element';
1212
export * from './wrapped-error-message';
13-
export * from './fake-viewport-ruler';
1413
export * from './mock-ng-zone';

src/lib/button/button.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {async, ComponentFixture, TestBed} from '@angular/core/testing';
22
import {Component, DebugElement} from '@angular/core';
33
import {By} from '@angular/platform-browser';
44
import {ViewportRuler} from '@angular/cdk/scrolling';
5-
import {FakeViewportRuler} from '@angular/cdk/testing';
65
import {MatButtonModule} from './index';
76
import {MatRipple} from '@angular/material/core';
87

@@ -13,9 +12,6 @@ describe('MatButton', () => {
1312
TestBed.configureTestingModule({
1413
imports: [MatButtonModule],
1514
declarations: [TestApp],
16-
providers: [
17-
{provide: ViewportRuler, useClass: FakeViewportRuler},
18-
]
1915
});
2016

2117
TestBed.compileComponents();

src/lib/radio/radio.spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {FormControl, FormsModule, NgModel, ReactiveFormsModule} from '@angular/f
33
import {Component, DebugElement} from '@angular/core';
44
import {By} from '@angular/platform-browser';
55
import {ViewportRuler} from '@angular/cdk/scrolling';
6-
import {dispatchFakeEvent, FakeViewportRuler} from '@angular/cdk/testing';
6+
import {dispatchFakeEvent} from '@angular/cdk/testing';
77
import {RIPPLE_FADE_IN_DURATION, RIPPLE_FADE_OUT_DURATION} from '@angular/material/core';
88
import {MatRadioButton, MatRadioChange, MatRadioGroup, MatRadioModule} from './index';
99

@@ -20,9 +20,6 @@ describe('MatRadio', () => {
2020
StandaloneRadioButtons,
2121
InterleavedRadioGroup,
2222
TranscludingWrapper
23-
],
24-
providers: [
25-
{provide: ViewportRuler, useClass: FakeViewportRuler}
2623
]
2724
});
2825

0 commit comments

Comments
 (0)