add bar graph, make changes to customgrid and custombars to match new structure
This commit is contained in:
20
test/component/bar-graph.test.tsx
Normal file
20
test/component/bar-graph.test.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react-native';
|
||||
import BarGraph from '../../component/charts/bar-graph/bar-graph';
|
||||
import { graph_data_two_measures } from '../../mock/charts/mock-data';
|
||||
|
||||
describe('BarGraph Component Tests', () => {
|
||||
|
||||
it('renders correctly with data', () => {
|
||||
const { getByTestId } = render(<BarGraph data={graph_data_two_measures} testID='1'/>);
|
||||
expect(getByTestId(`bar-graph-1`)).toBeTruthy();
|
||||
});
|
||||
|
||||
it('does not render without data', () => {
|
||||
// Have to ts-ignore to test null data conditions
|
||||
// @ts-ignore
|
||||
const { queryByTestId } = render(<BarGraph testID='2'/>);
|
||||
expect(queryByTestId(`bar-graph-2`)).toBeNull();
|
||||
});
|
||||
|
||||
});
|
@@ -29,8 +29,8 @@ describe('CustomBars Component Tests', () => {
|
||||
x={mockXScaleFunction}
|
||||
y={mockYScaleFunction}
|
||||
bandwidth={mockBandwidth}
|
||||
combinedData={mockCombinedData}
|
||||
rawData={mockRawData}
|
||||
barData={mockCombinedData}
|
||||
xValues={mockRawData}
|
||||
barColors={mockBarColors}
|
||||
gap={mockGap}
|
||||
roundedRadius={mockRoundedRadius}
|
||||
|
Reference in New Issue
Block a user