Files
imphnen-frontend-service/libs/ui/src/molecules/input-field/input-field.spec.tsx
T

21 lines
712 B
TypeScript
Raw Normal View History

import { render, screen } from '@testing-library/react';
2025-04-03 12:21:10 +07:00
import { InputField } from './input-field';
2025-04-03 12:31:16 +07:00
describe('InputField Component', () => {
it('renders correctly with disabled prop', () => {
2025-04-03 12:21:10 +07:00
render(<InputField label="Test Label" disabled={true} />);
const input = screen.getByLabelText('Test Label');
expect(input).toBeDisabled();
expect(input).toHaveClass('opacity-50 cursor-not-allowed');
});
it('renders correctly without disabled prop', () => {
2025-04-03 12:21:10 +07:00
render(<InputField label="Test Label" disabled={false} />);
const input = screen.getByLabelText('Test Label');
expect(input).not.toBeDisabled();
expect(input).not.toHaveClass('opacity-50 cursor-not-allowed');
});
});