33 async ,
44 fakeAsync ,
55 TestBed ,
6- tick ,
7- flush
6+ tick
87} from '@angular/core/testing' ;
98import { By } from '@angular/platform-browser' ;
109import { IgxCircularProgressBarComponent , IgxProgressBarModule } from './progressbar.component' ;
@@ -15,7 +14,6 @@ import { configureTestSuite } from '../test-utils/configure-suite';
1514const CIRCULAR_INNER_CLASS = 'igx-circular-bar__inner' ;
1615const CIRCULAR_OUTER_CLASS = 'igx-circular-bar__outer' ;
1716const CIRCULAR_TEXT_CLASS = 'igx-circular-bar__text' ;
18- const CIRCULAR_HIDDEN_TEXT_CLASS = 'igx-circular-bar__text--hidden' ;
1917const CIRCULAR_INDETERMINATE_CLASS = 'igx-circular-bar--indeterminate' ;
2018
2119describe ( 'IgCircularBar' , ( ) => {
@@ -248,17 +246,20 @@ describe('IgCircularBar', () => {
248246 it ( 'when passing string as value it should be parsed correctly' , ( ) => {
249247 const fix = TestBed . createComponent ( CircularBarComponent ) ;
250248 const compInstance = fix . componentInstance ;
251- const stringValue = '0.50' ;
249+ const stringValue = '10' ;
250+
251+ compInstance . animate = false ;
252+ fix . detectChanges ( ) ;
253+
252254 compInstance . value = stringValue ;
253255 fix . detectChanges ( ) ;
254256
255257 const bar = compInstance . progressbar ;
256-
257- const expectedRes = parseFloat ( stringValue ) ;
258+ const expectedRes = parseInt ( stringValue , 10 ) ;
258259 expect ( bar . value ) . toBe ( expectedRes ) ;
259260 } ) ;
260261
261- it ( 'when update step is bigger than passed value the progress indicator should follow the value representation' , ( ) => {
262+ it ( 'when update step is bigger than passed value the progress indicator should follow the value representation' , fakeAsync ( ( ) => {
262263 const fix = TestBed . createComponent ( InitCircularProgressBarComponent ) ;
263264 fix . detectChanges ( ) ;
264265
@@ -271,13 +272,14 @@ describe('IgCircularBar', () => {
271272 bar . value = value ;
272273
273274 fix . detectChanges ( ) ;
275+ tick ( tickTime ) ;
274276
275277 const percentValue = Common . calcPercentage ( value , max ) ;
276278 expect ( bar . value ) . toBe ( value ) ;
277279 expect ( bar . step ) . toBe ( step ) ;
278280 expect ( bar . max ) . toBe ( max ) ;
279281 expect ( bar . valueInPercent ) . toBe ( percentValue ) ;
280- } ) ;
282+ } ) ) ;
281283
282284 it ( `when step value is not divisble to passed value the result returned from the
283285 value getter should be the same as the passed one` , fakeAsync ( ( ) => {
0 commit comments