import { render, testA11y, screen } from '@fuels/jest';
import { Icon } from '../Icon';
import type { ListProps } from '.';
import { List } from './List';
const Content = (props: ListProps) => (
First item
Second item
Third item
);
describe('List', () => {
it('a11y', async () => {
await testA11y();
});
it('should render list correctly', async () => {
render();
expect(screen.getByText('First item')).toBeInTheDocument();
expect(screen.getByText('Second item')).toBeInTheDocument();
expect(screen.getByText('Third item')).toBeInTheDocument();
});
it('should render list with icon', async () => {
render();
const items = await screen.findAllByLabelText(/icon test/i);
expect(items.length).toBe(3);
});
});