import BooksListItem from './BooksListItem';
import { describe, expect, it } from 'vitest';
import { render } from '@testing-library/react';

describe('BooksListItem', () => {
  describe('Snapshots', () => {
    it('should match the snapshot', () => {
      const book = {
        id: 2,
        title: 'Clean Code',
        author: 'Robert Martin',
        isbn: '978-0132350884',
        rating: 4,
      };

      const { container } = render(
        <table>
          <tbody>
            <BooksListItem book={book} onRate={() => {}} />
          </tbody>
        </table>
      );
      expect(container).toMatchSnapshot();
    });
  });
});
