Skip to content

Commit

Permalink
feat(bar): adjust unit tests for new data
Browse files Browse the repository at this point in the history
  • Loading branch information
plouc committed Aug 14, 2021
1 parent 06ce5fb commit c48e43f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions packages/bar/tests/Bar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,13 @@ it(`should generate grouped bars correctly when keys are mismatched`, () => {
},
height: 300,
key: 'A.one',
index: 0,
label: 'A - one',
width: 71.33333333333333,
x: 24,
y: 0,
absX: 24,
absY: 0,
})

expect(bars.at(1).prop('bar')).toEqual({
Expand All @@ -412,10 +415,13 @@ it(`should generate grouped bars correctly when keys are mismatched`, () => {
},
height: 270,
key: 'B.two',
index: 1,
label: 'B - two',
width: 71.33333333333333,
x: 333.3333333333333,
y: 30,
absX: 333.3333333333333,
absY: 30,
})

expect(bars.at(2).prop('bar')).toEqual({
Expand All @@ -431,10 +437,13 @@ it(`should generate grouped bars correctly when keys are mismatched`, () => {
},
height: 90,
key: 'C.one',
index: 2,
label: 'C - one',
width: 71.33333333333333,
x: 166.66666666666666,
y: 210,
absX: 166.66666666666666,
absY: 210,
})
})

Expand Down Expand Up @@ -469,10 +478,13 @@ it(`should generate stacked bars correctly when keys are mismatched`, () => {
},
height: 231,
key: 'A.one',
index: 0,
label: 'A - one',
width: 214,
x: 24,
y: 69,
absX: 24,
absY: 69,
})

expect(bars.at(1).prop('bar')).toEqual({
Expand All @@ -488,10 +500,13 @@ it(`should generate stacked bars correctly when keys are mismatched`, () => {
},
height: 208,
key: 'B.two',
index: 1,
label: 'B - two',
width: 214,
x: 262,
y: 92,
absX: 262,
absY: 92,
})

expect(bars.at(2).prop('bar')).toEqual({
Expand All @@ -507,10 +522,13 @@ it(`should generate stacked bars correctly when keys are mismatched`, () => {
},
height: 69,
key: 'C.one',
index: 2,
label: 'C - one',
width: 214,
x: 24,
y: 0,
absX: 24,
absY: 0,
})
})

Expand Down
2 changes: 1 addition & 1 deletion website/src/pages/bar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const initialProperties = {
motionConfig: 'default',

role: 'application',
isFocusable: true,
isFocusable: false,
ariaLabel: 'Nivo bar chart demo',
barAriaLabel: data => `${data.id}: ${data.formattedValue} in country: ${data.indexValue}`,
}
Expand Down

0 comments on commit c48e43f

Please sign in to comment.