@vertisanpro/flowbite-react
Version:
Non-Official React components built for Flowbite and Tailwind CSS
29 lines (28 loc) • 1.06 kB
JavaScript
import { render, screen } from '@testing-library/react';
import React from 'react';
import { describe, expect, it } from 'vitest';
import { Flowbite } from '../Flowbite';
import { Radio } from './Radio';
describe.concurrent('Components / Radio', () => {
describe.concurrent('A11y', () => {
it('should have role="radio" by default', () => {
const radio = render(React.createElement(Radio, null)).getByRole('radio');
expect(radio).toBeInTheDocument();
});
});
describe('Theme', () => {
it('should use custom `base` classes', () => {
const theme = {
radio: {
root: {
base: 'bg-yellow-400 dark:bg-yellow-40',
},
},
};
render(React.createElement(Flowbite, { theme: { theme } },
React.createElement(Radio, null)));
expect(radio()).toHaveClass('bg-yellow-400 dark:bg-yellow-40');
});
});
});
const radio = () => screen.getByRole('radio');