@@ -5,7 +5,7 @@ import CircleContainer from "@/components/Circle/CircleContainer.vue";
5
5
import Counter from "@/components/Counter.vue" ;
6
6
import { animationParser , dotParser , dashParser , lineModeParser , linePositionParser } from "@/components/optionsParser" ;
7
7
import props from "@/components/interface" ;
8
- import { defaultCounterTick } from "@/../tests/helper" ;
8
+ import { defaultCounterTick , wait } from "@/../tests/helper" ;
9
9
import { nextTick } from "vue" ;
10
10
11
11
const factory = ( propsData , slots = { } ) => {
@@ -251,14 +251,15 @@ describe("[ EllipseProgressContainer.vue ]", () => {
251
251
} ;
252
252
factory ( { progress : 1 , legendFormatter : formatter , animation : "default 0 0" } ) ;
253
253
} ) ;
254
- it ( "renders the custom formatted value" , ( done ) => {
254
+ it ( "renders the custom formatted value" , async ( ) => {
255
255
const customFormat = ( value ) => `Formatted: ${ value } ` ;
256
256
const formatter = ( { currentValue } ) => customFormat ( currentValue ) ;
257
257
const wrapper = factory ( { legend : 120 , legendFormatter : formatter , animation : "default 0 0" } ) ;
258
- setTimeout ( ( ) => {
259
- expect ( wrapper . find ( ".ep-legend--value__counter" ) . element . textContent ) . to . equal ( customFormat ( 120 ) ) ;
260
- done ( ) ;
261
- } , 100 ) ;
258
+
259
+ await wait ( 200 ) ;
260
+ await nextTick ( ) ;
261
+
262
+ expect ( wrapper . find ( ".ep-legend--value__counter" ) . element . textContent ) . to . equal ( customFormat ( 120 ) ) ;
262
263
} ) ;
263
264
it ( "isHTML returns false by default " , ( ) => {
264
265
expect ( factory ( { legendFormatter : ( ) => "Custom" } ) . vm . isHTML ) . to . be . false ;
0 commit comments