-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop double formatting in label calculation
- Loading branch information
1 parent
5a84e48
commit 760c8c2
Showing
2 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...polaris-viz/src/components/DonutChart/components/LegendValues/tests/LegendValues.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {mount} from '@shopify/react-testing'; | ||
|
||
import {LegendValues} from '../LegendValues'; | ||
|
||
const mockProps = { | ||
data: [ | ||
{ | ||
name: 'Shopify Payments', | ||
data: [{key: 'april - march', value: 50000}], | ||
}, | ||
], | ||
activeIndex: 1, | ||
legendFullWidth: false, | ||
labelFormatter: (val) => `${val}!`, | ||
getColorVisionStyles: jest.fn(), | ||
getColorVisionEventAttrs: jest.fn(), | ||
seriesNameFormatter: (val) => `${val}!`, | ||
renderHiddenLegendLabel: jest.fn(), | ||
} as any; | ||
|
||
describe('<LegendValues />', () => { | ||
it('renders a table', async () => { | ||
const legendValues = mount(<LegendValues {...mockProps} />); | ||
expect(legendValues).toContainReactComponent('table', { | ||
style: {maxWidth: 197.22, width: '100%'}, | ||
}); | ||
}); | ||
}); |