mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-19 21:16:18 +00:00
Move shlink-web-component tests to their own folder
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { DoughnutChart } from '../../../src/visits/charts/DoughnutChart';
|
||||
import { setUpCanvas } from '../../__helpers__/setUpTest';
|
||||
|
||||
describe('<DoughnutChart />', () => {
|
||||
const stats = {
|
||||
foo: 123,
|
||||
bar: 456,
|
||||
};
|
||||
|
||||
it('renders Doughnut with expected props', () => {
|
||||
const { events } = setUpCanvas(<DoughnutChart stats={stats} />);
|
||||
|
||||
expect(events).toBeTruthy();
|
||||
expect(events).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('renders expected legend', () => {
|
||||
setUpCanvas(<DoughnutChart stats={stats} />);
|
||||
|
||||
expect(screen.getByText('foo')).toBeInTheDocument();
|
||||
expect(screen.getByText('bar')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user