@vertisanpro/flowbite-react
Version:
Non-Official React components built for Flowbite and Tailwind CSS
18 lines (17 loc) • 769 B
JavaScript
import { render } from '@testing-library/react';
import { HiEye } from '@vertisanpro/react-icons/hi';
import React from 'react';
import { describe, expect, it } from 'vitest';
import { TextInput } from './TextInput';
describe.concurrent('Components / Text input', () => {
describe.concurrent('A11y', () => {
it('should have `role="textbox"` by default', () => {
const textInput = render(React.createElement(TextInput, null)).getByRole('textbox');
expect(textInput).toBeInTheDocument();
});
it('should have Icon if selected ', () => {
const page = render(React.createElement(TextInput, { rightIcon: HiEye })).getByTestId('right-icon');
expect(page).toBeInTheDocument();
});
});
});