fix: unit test for button and input-field component
This commit is contained in:
@@ -24,9 +24,9 @@ describe('Test Button Component', () => {
|
||||
|
||||
const button = screen.getByText('Delete');
|
||||
|
||||
expect(button).toHaveClass('bg-danger-500');
|
||||
expect(button).toHaveClass('hover:bg-danger-600');
|
||||
expect(button).toHaveClass('text-white');
|
||||
expect(button).toHaveClass('bg-danger-100');
|
||||
expect(button).toHaveClass('hover:bg-danger-200');
|
||||
expect(button).toHaveClass('text-danger-500');
|
||||
});
|
||||
|
||||
it("disables the button when 'disabled' prop is set", async () => {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { InputField } from './input-field';
|
||||
|
||||
describe('InputField Component', () => {
|
||||
it('renders correctly with disabled prop', () => {
|
||||
render(<InputField label="Test Label" disabled={true} />);
|
||||
render(<InputField htmlFor="test" label="Test Label" disabled={true} />);
|
||||
|
||||
const input = screen.getByLabelText('Test Label');
|
||||
expect(input).toBeDisabled();
|
||||
@@ -11,7 +11,7 @@ describe('InputField Component', () => {
|
||||
});
|
||||
|
||||
it('renders correctly without disabled prop', () => {
|
||||
render(<InputField label="Test Label" disabled={false} />);
|
||||
render(<InputField htmlFor="test" label="Test Label" disabled={false} />);
|
||||
|
||||
const input = screen.getByLabelText('Test Label');
|
||||
expect(input).not.toBeDisabled();
|
||||
|
||||
Reference in New Issue
Block a user