@@ -83,6 +83,24 @@ describe('MatProgressSpinner', () => {
83
83
expect ( progressElement . componentInstance . value ) . toBe ( 75 ) ;
84
84
} ) ;
85
85
86
+ it ( 'should use different `circle` elements depending on the mode' , ( ) => {
87
+ const fixture = TestBed . createComponent ( ProgressSpinnerWithValueAndBoundMode ) ;
88
+
89
+ fixture . componentInstance . mode = 'determinate' ;
90
+ fixture . detectChanges ( ) ;
91
+
92
+ const determinateCircle = fixture . nativeElement . querySelector ( 'circle' ) ;
93
+
94
+ fixture . componentInstance . mode = 'indeterminate' ;
95
+ fixture . detectChanges ( ) ;
96
+
97
+ const indeterminateCircle = fixture . nativeElement . querySelector ( 'circle' ) ;
98
+
99
+ expect ( determinateCircle ) . toBeTruthy ( ) ;
100
+ expect ( indeterminateCircle ) . toBeTruthy ( ) ;
101
+ expect ( determinateCircle ) . not . toBe ( indeterminateCircle ) ;
102
+ } ) ;
103
+
86
104
it ( 'should clamp the value of the progress between 0 and 100' , ( ) => {
87
105
let fixture = TestBed . createComponent ( BasicProgressSpinner ) ;
88
106
fixture . detectChanges ( ) ;
@@ -138,12 +156,13 @@ describe('MatProgressSpinner', () => {
138
156
139
157
it ( 'should allow a custom stroke width' , ( ) => {
140
158
const fixture = TestBed . createComponent ( ProgressSpinnerCustomStrokeWidth ) ;
141
- const circleElement = fixture . nativeElement . querySelector ( 'circle' ) ;
142
- const svgElement = fixture . nativeElement . querySelector ( 'svg' ) ;
143
159
144
160
fixture . componentInstance . strokeWidth = 40 ;
145
161
fixture . detectChanges ( ) ;
146
162
163
+ const circleElement = fixture . nativeElement . querySelector ( 'circle' ) ;
164
+ const svgElement = fixture . nativeElement . querySelector ( 'svg' ) ;
165
+
147
166
expect ( parseInt ( circleElement . style . strokeWidth ) ) . toBe ( 40 , 'Expected the custom stroke ' +
148
167
'width to be applied to the circle element as a percentage of the element size.' ) ;
149
168
expect ( svgElement . getAttribute ( 'viewBox' ) )
0 commit comments