Skip to content

Commit

Permalink
Update Chart
Browse files Browse the repository at this point in the history
  • Loading branch information
geoperez committed Nov 13, 2023
1 parent 29cd9b0 commit 2253fe2
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 23 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"recharts": "^2.9.3",
"tailwind-merge": "^2.0.0",
"tailwind-styled-components": "^2.2.0",
"uno-js": "^3.56.0"
"uno-js": "^3.57.0"
},
"devDependencies": {
"@rspack/cli": "^0.3.11",
Expand All @@ -38,10 +38,10 @@
"husky": "^8.0.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lint-staged": "^15.0.2",
"lint-staged": "^15.1.0",
"object-hash": "^3.0.0",
"postcss-loader": "^7.3.3",
"prettier": "^3.0.3",
"prettier": "^3.1.0",
"tailwindcss": "^3.3.5",
"ts-jest": "^29.1.1",
"typescript": "^5.2.2"
Expand Down
43 changes: 24 additions & 19 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/ChartBar/ChartBar.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ describe('ChartBar', () => {
expect(getByText('Ref Line')).toBeInTheDocument();
});

it('renders loading', () => {
const undefinedValue: number[] | undefined = undefined;
const callback = (data: number[]) => [];

const { container } = render(<ChartBar rawData={undefinedValue} dataCallback={callback} />);

expect(container.querySelector('.loading-shimmer')).toBeInTheDocument();
});

it('renders the no data legend', () => {
const { getByText } = render(<ChartBar rawData={[]} dataCallback={identity} />);
expect(getByText('No record found')).toBeInTheDocument();
Expand Down
9 changes: 9 additions & 0 deletions src/DataChart/DataChart.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ describe('DataChart', () => {
render(<DataChart rawData={[]} dataCallback={identity} />);
});

it('renders loading', () => {
const undefinedValue: number[] | undefined = undefined;
const callback = (data: number[]) => [];

const { container } = render(<DataChart rawData={undefinedValue} dataCallback={callback} />);

expect(container.querySelector('.loading-shimmer')).toBeInTheDocument();
});

it('renders the no data legend', () => {
const { getByText } = render(<DataChart rawData={[]} dataCallback={identity} />);
expect(getByText('No record found')).toBeInTheDocument();
Expand Down
11 changes: 10 additions & 1 deletion src/PieChart/PieChart.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,16 @@ describe('PieChart', () => {
const slices = container.querySelectorAll('.recharts-pie-sector');
expect(slices.length).toBe(dataStore.length);
});


it('renders loading', () => {
const undefinedValue: number[] | undefined = undefined;
const callback = (data: number[]) => [];

const { container } = render(<PieChart rawData={undefinedValue} dataCallback={callback} />);

expect(container.querySelector('.loading-shimmer')).toBeInTheDocument();
});

it('renders the no data legend', () => {
const { getByText } = render(<PieChart rawData={[]} dataCallback={identity} />);
expect(getByText('No record found')).toBeInTheDocument();
Expand Down

0 comments on commit 2253fe2

Please sign in to comment.