feat: Update InputForm, Input, and auth page

- Perbaiki page login ke halaman utama backoffice
- Perbaiki component Input dan InputForm
This commit is contained in:
Hafid Nur
2025-03-27 07:19:46 +07:00
parent 631684cb05
commit 542469bc67
11 changed files with 138 additions and 272 deletions
+7 -28
View File
@@ -1,36 +1,15 @@
import { describe, it, expect } from "vitest";
import { render, screen } from "@testing-library/react";
import { Input } from "./input";
import { describe, it, expect } from 'vitest';
import { render, screen } from '@testing-library/react';
import { Input } from './input';
describe("Test Input Component", () => {
it("renders the input with placeholder text", () => {
describe('Test Input Component', () => {
it('renders the input with placeholder text', () => {
render(<Input placeholder="Placeholder" />);
expect(screen.getByPlaceholderText("Placeholder")).toBeInTheDocument();
expect(screen.getByPlaceholderText('Placeholder')).toBeInTheDocument();
});
// it("renders the input with different sizes", () => {
// const sizeClasses = {
// sm: "text-[10px] max-h-[28px]",
// md: "text-[12px] max-h-[30px]",
// lg: "text-[15px] max-h-[34px]",
// };
// Object.entries(sizeClasses).forEach(([size, className]) => {
// render(<Input size={size} />);
// expect(screen.getByRole("textbox")).toHaveClass(className);
// });
// });
// it("renders the input with different types", () => {
// const types = ["text", "password", "email", "number"];
// types.forEach((type) => {
// render(<Input type={type} />);
// const input = screen.getByRole("textbox");
// expect(input).toHaveAttribute("type", type);
// });
// });
it("disables the input field when 'disabled' prop is set", () => {
render(<Input disabled />);
expect(screen.getByRole("textbox")).toBeDisabled();
expect(screen.getByRole('textbox')).toBeDisabled();
});
});