@@ -263,23 +263,43 @@ describe("CoreChart: utils", () => {
263263 scenario : "getItemProps is undefined" ,
264264 getItemProps : undefined ,
265265 id : "item1" ,
266- expected : { status : "default" } ,
266+ expected : { status : "default" , markerAriaDescription : undefined } ,
267267 } ,
268268 {
269269 scenario : "getItemProps returns empty object" ,
270270 getItemProps : ( ) => ( { } ) ,
271271 id : "item1" ,
272- expected : { status : "default" } ,
272+ expected : { status : "default" , markerAriaDescription : undefined } ,
273273 } ,
274274 {
275275 scenario : "getItemProps returns status" ,
276- getItemProps : ( ) => ( { status : "active " as const } ) ,
276+ getItemProps : ( ) => ( { status : "warning " as const } ) ,
277277 id : "item1" ,
278- expected : { status : "active" } ,
278+ expected : { status : "warning" , markerAriaDescription : undefined } ,
279279 } ,
280- ] ) ( "$scenario" , ( { getItemProps, id, expected } ) => {
280+ {
281+ scenario : "getItemProps returns status and contains i18n" ,
282+ getItemProps : ( ) => ( { status : "warning" as const } ) ,
283+ id : "item1" ,
284+ expected : { status : "warning" , markerAriaDescription : "hello hi" } ,
285+ options : {
286+ markerAriaDescriptionTemplate : "hello {status}" ,
287+ getI18nFromStatus : ( ) : string => "hi" ,
288+ } ,
289+ } ,
290+ {
291+ scenario : "getItemProps returns status and contains i18n - getI18nFromStatus returns undefined" ,
292+ getItemProps : ( ) => ( { status : "warning" as const } ) ,
293+ id : "item1" ,
294+ expected : { status : "warning" , markerAriaDescription : undefined } ,
295+ options : {
296+ markerAriaDescriptionTemplate : "hello {status}" ,
297+ getI18nFromStatus : ( ) : undefined => undefined ,
298+ } ,
299+ } ,
300+ ] ) ( "$scenario" , ( { getItemProps, id, expected, options } ) => {
281301 it ( "should return correct default values" , ( ) => {
282- const result = fillDefaultsForGetItemProps ( getItemProps ) ;
302+ const result = fillDefaultsForGetItemProps ( getItemProps , options ) ;
283303 expect ( result ( id ) ) . toEqual ( expected ) ;
284304 } ) ;
285305 } ) ;
0 commit comments