feat: Update InputForm to handle different sizes

- Tambah spec test pada komponen InputForm
- Tambah autodocs pada komponen Input
This commit is contained in:
Hafid Nur
2025-03-27 06:00:03 +07:00
parent 54f4572533
commit 631684cb05
3 changed files with 47 additions and 4 deletions
@@ -0,0 +1,20 @@
import { render, screen } from '@testing-library/react';
import InputForm from './input-form';
describe('InputForm Component', () => {
it('renders correctly with disabled prop', () => {
render(<InputForm 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', () => {
render(<InputForm label="Test Label" disabled={false} />);
const input = screen.getByLabelText('Test Label');
expect(input).not.toBeDisabled();
expect(input).not.toHaveClass('opacity-50 cursor-not-allowed');
});
});