UNPKG

@vertisanpro/flowbite-react

Version:

Non-Official React components built for Flowbite and Tailwind CSS

20 lines (19 loc) 1.02 kB
import { render, screen } from '@testing-library/react'; import React from 'react'; import { describe, expect, it } from 'vitest'; import { AvatarGroup } from './AvatarGroup'; describe('Components / Avatar.Group', () => { it('renders the avatar group element with the correct classname', () => { render(React.createElement(AvatarGroup, { className: "test-class" }, React.createElement("div", null, "Test child"))); const avatarGroupElement = screen.getByTestId('avatar-group-element'); expect(avatarGroupElement).toBeInTheDocument(); expect(avatarGroupElement).toHaveClass('test-class'); }); it('merges the custom theme with the default theme', () => { render(React.createElement(AvatarGroup, { theme: { base: 'custom-base-class' } }, React.createElement("div", null, "Test child"))); const avatarGroupElement = screen.getByTestId('avatar-group-element'); expect(avatarGroupElement).toHaveClass('custom-base-class'); }); });