Skip to content

Commit

Permalink
Update src/components/TagCloud/tagcloud.tests.tsx
Browse files Browse the repository at this point in the history
Co-authored-by: codiumai-pr-agent[bot] <138128286+codiumai-pr-agent[bot]@users.noreply.github.com>
  • Loading branch information
tomek-i and codiumai-pr-agent-free[bot] authored Aug 29, 2024
1 parent 82ba81d commit 4db6909
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/components/TagCloud/tagcloud.tests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,23 @@ import renderer from 'react-test-renderer';

import { TagCloud } from './TagCloud';

describe('TagCloud component', () => {
it('should render snapshot', () => {
const component = renderer.create(<TagCloud tags={[]} />);
import { render, screen } from '@testing-library/react';

describe('TagCloud component', () => {
it('should render snapshot with empty tags', () => {
const component = renderer.create();
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});

it('should render tags correctly', () => {
const tags = [
{ tag: 'React', count: 5 },
{ tag: 'TypeScript', count: 3 },
];
render();
expect(screen.getByText('React')).toBeInTheDocument();
expect(screen.getByText('TypeScript')).toBeInTheDocument();
});
});
});

0 comments on commit 4db6909

Please sign in to comment.