// ContactList.test.jsimport React from 'react';import { render } from '@testing-library/react';import ContactList from './ContactList';// Mock data for testingconst mockContacts = [ { id: 1, name: 'John Doe' }, { id: 2, name: 'Jane Smith' },];test('renders a list of contacts', () => { // Render the ContactList component with mock data const { getByText } = render(<ContactList contacts={mockContacts} />); // Verify that each contact name is rendered mockContacts.forEach(contact => { const contactElement = getByText(contact.name); expect(contactElement).toBeInTheDocument(); });});test('renders correct number of contacts', () => { // Render the ContactList component with mock data const { container } = render(<ContactList contacts={mockContacts} />); // Verify that the correct number of contact list items are rendered const contactListItems = container.querySelectorAll('li'); expect(contactListItems.length).toBe(mockContacts.length);});