Skip to content

Commit 53811a5

Browse files
committed
feat(bar): adjust unit tests for new data
1 parent a5aa25c commit 53811a5

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

packages/bar/tests/Bar.test.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,13 @@ it(`should generate grouped bars correctly when keys are mismatched`, () => {
393393
},
394394
height: 300,
395395
key: 'A.one',
396+
index: 0,
396397
label: 'A - one',
397398
width: 71.33333333333333,
398399
x: 24,
399400
y: 0,
401+
absX: 24,
402+
absY: 0,
400403
})
401404

402405
expect(bars.at(1).prop('bar')).toEqual({
@@ -412,10 +415,13 @@ it(`should generate grouped bars correctly when keys are mismatched`, () => {
412415
},
413416
height: 270,
414417
key: 'B.two',
418+
index: 1,
415419
label: 'B - two',
416420
width: 71.33333333333333,
417421
x: 333.3333333333333,
418422
y: 30,
423+
absX: 333.3333333333333,
424+
absY: 30,
419425
})
420426

421427
expect(bars.at(2).prop('bar')).toEqual({
@@ -431,10 +437,13 @@ it(`should generate grouped bars correctly when keys are mismatched`, () => {
431437
},
432438
height: 90,
433439
key: 'C.one',
440+
index: 2,
434441
label: 'C - one',
435442
width: 71.33333333333333,
436443
x: 166.66666666666666,
437444
y: 210,
445+
absX: 166.66666666666666,
446+
absY: 210,
438447
})
439448
})
440449

@@ -469,10 +478,13 @@ it(`should generate stacked bars correctly when keys are mismatched`, () => {
469478
},
470479
height: 231,
471480
key: 'A.one',
481+
index: 0,
472482
label: 'A - one',
473483
width: 214,
474484
x: 24,
475485
y: 69,
486+
absX: 24,
487+
absY: 69,
476488
})
477489

478490
expect(bars.at(1).prop('bar')).toEqual({
@@ -488,10 +500,13 @@ it(`should generate stacked bars correctly when keys are mismatched`, () => {
488500
},
489501
height: 208,
490502
key: 'B.two',
503+
index: 1,
491504
label: 'B - two',
492505
width: 214,
493506
x: 262,
494507
y: 92,
508+
absX: 262,
509+
absY: 92,
495510
})
496511

497512
expect(bars.at(2).prop('bar')).toEqual({
@@ -507,10 +522,13 @@ it(`should generate stacked bars correctly when keys are mismatched`, () => {
507522
},
508523
height: 69,
509524
key: 'C.one',
525+
index: 2,
510526
label: 'C - one',
511527
width: 214,
512528
x: 24,
513529
y: 0,
530+
absX: 24,
531+
absY: 0,
514532
})
515533
})
516534

website/src/pages/bar/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ const initialProperties = {
153153
motionConfig: 'default',
154154

155155
role: 'application',
156-
isFocusable: true,
156+
isFocusable: false,
157157
ariaLabel: 'Nivo bar chart demo',
158158
barAriaLabel: data => `${data.id}: ${data.formattedValue} in country: ${data.indexValue}`,
159159
}

0 commit comments

Comments
 (0)