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

16 lines
534 B
TypeScript
Raw Normal View History

import { describe, it, expect } from 'vitest';
import { render, screen } from '@testing-library/react';
import { Input } from './input';
2025-03-16 00:56:02 +07:00
describe('Test Input Component', () => {
it('renders the input with placeholder text', () => {
2025-03-16 00:56:02 +07:00
render(<Input placeholder="Placeholder" />);
expect(screen.getByPlaceholderText('Placeholder')).toBeInTheDocument();
2025-03-16 00:56:02 +07:00
});
it("disables the input field when 'disabled' prop is set", () => {
render(<Input disabled />);
expect(screen.getByRole('textbox')).toBeDisabled();
2025-03-16 00:56:02 +07:00
});
});