1
- import { TestBed , waitForAsync , inject } from '@angular/core/testing' ;
1
+ import { TestBed , waitForAsync } from '@angular/core/testing' ;
2
2
import { Component , ViewEncapsulation , ViewChild , ElementRef } from '@angular/core' ;
3
3
import { By } from '@angular/platform-browser' ;
4
- import { Platform , _getShadowRoot , _supportsShadowDom } from '@angular/cdk/platform' ;
4
+ import { _getShadowRoot , _supportsShadowDom } from '@angular/cdk/platform' ;
5
5
import { CommonModule } from '@angular/common' ;
6
6
import {
7
7
MatProgressSpinnerModule ,
@@ -158,13 +158,7 @@ describe('MatProgressSpinner', () => {
158
158
} ) ;
159
159
160
160
it ( 'should add a style tag with the indeterminate animation to the document head when using a ' +
161
- 'non-default diameter' , inject ( [ Platform ] , ( platform : Platform ) => {
162
- // On Edge and IE we use a fallback animation because the
163
- // browser doesn't support animating SVG correctly.
164
- if ( platform . EDGE || platform . TRIDENT ) {
165
- return ;
166
- }
167
-
161
+ 'non-default diameter' , ( ) => {
168
162
const fixture = TestBed . createComponent ( ProgressSpinnerCustomDiameter ) ;
169
163
fixture . componentInstance . diameter = 32 ;
170
164
fixture . detectChanges ( ) ;
@@ -184,7 +178,7 @@ describe('MatProgressSpinner', () => {
184
178
185
179
expect ( document . head . querySelectorAll ( 'style[mat-spinner-animation="32"]' ) . length ) . toBe ( 1 ) ;
186
180
expect ( document . head . querySelectorAll ( 'style[mat-spinner-animation="64"]' ) . length ) . toBe ( 1 ) ;
187
- } ) ) ;
181
+ } ) ;
188
182
189
183
it ( 'should allow floating point values for custom diameter' , ( ) => {
190
184
const fixture = TestBed . createComponent ( ProgressSpinnerCustomDiameter ) ;
@@ -207,26 +201,19 @@ describe('MatProgressSpinner', () => {
207
201
. toBe ( '0 0 25.75 25.75' , 'Expected the custom diameter to be applied to the svg viewBox.' ) ;
208
202
} ) ;
209
203
210
- it ( 'should handle creating animation style tags based on a floating point diameter' ,
211
- inject ( [ Platform ] , ( platform : Platform ) => {
212
- // On Edge and IE we use a fallback animation because the
213
- // browser doesn't support animating SVG correctly.
214
- if ( platform . EDGE || platform . TRIDENT ) {
215
- return ;
216
- }
217
-
218
- const fixture = TestBed . createComponent ( IndeterminateSpinnerCustomDiameter ) ;
204
+ it ( 'should handle creating animation style tags based on a floating point diameter' , ( ) => {
205
+ const fixture = TestBed . createComponent ( IndeterminateSpinnerCustomDiameter ) ;
219
206
220
- fixture . componentInstance . diameter = 32.5 ;
221
- fixture . detectChanges ( ) ;
207
+ fixture . componentInstance . diameter = 32.5 ;
208
+ fixture . detectChanges ( ) ;
222
209
223
- const circleElement = fixture . nativeElement . querySelector ( 'circle' ) ;
210
+ const circleElement = fixture . nativeElement . querySelector ( 'circle' ) ;
224
211
225
- expect ( circleElement . style . animationName ) . toBe ( 'mat-progress-spinner-stroke-rotate-32_5' ,
226
- 'Expected the spinner circle element to have an animation name based on the custom diameter' ) ;
227
- expect ( document . head . querySelectorAll ( 'style[mat-spinner-animation="32_5"]' ) . length ) . toBe ( 1 ,
228
- 'Expected a style tag with the indeterminate animation to be attached to the document head' ) ;
229
- } ) ) ;
212
+ expect ( circleElement . style . animationName ) . toBe ( 'mat-progress-spinner-stroke-rotate-32_5' ,
213
+ 'Expected the spinner circle element to have an animation name based on the custom diameter' ) ;
214
+ expect ( document . head . querySelectorAll ( 'style[mat-spinner-animation="32_5"]' ) . length ) . toBe ( 1 ,
215
+ 'Expected a style tag with the indeterminate animation to be attached to the document head' ) ;
216
+ } ) ;
230
217
231
218
it ( 'should allow a custom stroke width' , ( ) => {
232
219
const fixture = TestBed . createComponent ( ProgressSpinnerCustomStrokeWidth ) ;
0 commit comments