2022-04-27 23:25:32 +00:00
|
|
|
/**
|
|
|
|
* @format
|
|
|
|
*/
|
|
|
|
|
|
|
|
import 'react-native';
|
|
|
|
import React from 'react';
|
|
|
|
import AreaTwo from '../examples/LineChart/AreaTwo';
|
|
|
|
import LineChartTwo from '../examples/LineChart/LineChartTwo';
|
|
|
|
import SimpleBlueLine from '../examples/LineChart/SimpleBlueLine';
|
2022-05-16 10:30:56 +00:00
|
|
|
import ChartWithPointer from '../examples/LineChart/ChartWithPointer';
|
|
|
|
import ChartWithAdjustingPointer from '../examples/LineChart/ChartWithAdjustingPointer';
|
|
|
|
import ScrollingChartWithPointer from '../examples/LineChart/ScrollingChartWithPointer';
|
|
|
|
import CaloriesBurnt from '../examples/LineChart/CaloriesBurnt';
|
2022-05-26 07:57:02 +00:00
|
|
|
import SimpleBlueLineWithGivenNumberOfVerticalLines from '../examples/LineChart/SimpleBlueLineWithGivenNumberOfVerticalLines';
|
2022-04-27 23:25:32 +00:00
|
|
|
|
|
|
|
// Note: test renderer must be required after react-native.
|
|
|
|
import renderer from 'react-test-renderer';
|
|
|
|
|
2023-07-02 10:29:10 +00:00
|
|
|
describe('Line and Area chart tests', () => {
|
|
|
|
it('renders 2 area chart correctly', () => {
|
|
|
|
const tree = renderer.create(<AreaTwo />).toJSON();
|
|
|
|
expect(tree).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders 2 line chart correctly', () => {
|
|
|
|
const tree = renderer.create(<LineChartTwo />).toJSON();
|
|
|
|
expect(tree).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders blue line chart correctly', () => {
|
|
|
|
const tree = renderer.create(<SimpleBlueLine />).toJSON();
|
|
|
|
expect(tree).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders ChartWithPointer correctly', () => {
|
|
|
|
const tree = renderer.create(<ChartWithPointer />).toJSON();
|
|
|
|
expect(tree).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders ChartWithAdjustingPointer correctly', () => {
|
|
|
|
const tree = renderer.create(<ChartWithAdjustingPointer />).toJSON();
|
|
|
|
expect(tree).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders ScrollingChartWithPointer correctly', () => {
|
|
|
|
const tree = renderer.create(<ScrollingChartWithPointer />).toJSON();
|
|
|
|
expect(tree).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders CaloriesBurnt Area chart correctly', () => {
|
|
|
|
const tree = renderer.create(<CaloriesBurnt />).toJSON();
|
|
|
|
expect(tree).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders blue line chart with given number of vertical lines correctly', () => {
|
|
|
|
const tree = renderer
|
|
|
|
.create(<SimpleBlueLineWithGivenNumberOfVerticalLines />)
|
|
|
|
.toJSON();
|
|
|
|
expect(tree).toMatchSnapshot();
|
|
|
|
});
|
2022-05-26 07:57:02 +00:00
|
|
|
});
|