diff --git a/frontend/__tests__/components/features/onboarding/information-request-form.test.tsx b/frontend/__tests__/components/features/onboarding/information-request-form.test.tsx index 69eb001bb4..6de5785ae5 100644 --- a/frontend/__tests__/components/features/onboarding/information-request-form.test.tsx +++ b/frontend/__tests__/components/features/onboarding/information-request-form.test.tsx @@ -2,7 +2,7 @@ import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { describe, expect, it, vi, beforeEach } from "vitest"; import { MemoryRouter } from "react-router"; -import { InformationRequestForm } from "#/components/features/onboarding/information-request-form"; +import { InformationRequestForm, RequestType } from "#/components/features/onboarding/information-request-form"; // Mock useNavigate const mockNavigate = vi.fn(); @@ -16,7 +16,7 @@ vi.mock("react-router", async () => { describe("InformationRequestForm", () => { const defaultProps = { - requestType: "saas" as const, + requestType: "saas" as RequestType, onBack: vi.fn(), }; diff --git a/frontend/__tests__/components/features/onboarding/step-input.test.tsx b/frontend/__tests__/components/features/onboarding/step-input.test.tsx deleted file mode 100644 index a4f388efbb..0000000000 --- a/frontend/__tests__/components/features/onboarding/step-input.test.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import { render, screen } from "@testing-library/react"; -import userEvent from "@testing-library/user-event"; -import { describe, expect, it, vi } from "vitest"; -import { StepInput } from "#/components/features/onboarding/step-input"; - -describe("StepInput", () => { - const defaultProps = { - id: "test-input", - label: "Test Label", - value: "", - onChange: vi.fn(), - }; - - it("should render with correct test id", () => { - render(); - - expect(screen.getByTestId("step-input-test-input")).toBeInTheDocument(); - }); - - it("should render the label", () => { - render(); - - expect(screen.getByText("Test Label")).toBeInTheDocument(); - }); - - it("should display the provided value", () => { - render(); - - const input = screen.getByTestId("step-input-test-input"); - expect(input).toHaveValue("Hello World"); - }); - - it("should call onChange when user types", async () => { - const mockOnChange = vi.fn(); - const user = userEvent.setup(); - - render(); - - const input = screen.getByTestId("step-input-test-input"); - await user.type(input, "a"); - - expect(mockOnChange).toHaveBeenCalledWith("a"); - }); - - it("should call onChange with the full input value on each keystroke", async () => { - const mockOnChange = vi.fn(); - const user = userEvent.setup(); - - render(); - - const input = screen.getByTestId("step-input-test-input"); - await user.type(input, "abc"); - - expect(mockOnChange).toHaveBeenCalledTimes(3); - expect(mockOnChange).toHaveBeenNthCalledWith(1, "a"); - expect(mockOnChange).toHaveBeenNthCalledWith(2, "b"); - expect(mockOnChange).toHaveBeenNthCalledWith(3, "c"); - }); - - it("should use the id prop for data-testid", () => { - render(); - - expect(screen.getByTestId("step-input-org_name")).toBeInTheDocument(); - }); - - it("should render as a text input", () => { - render(); - - const input = screen.getByTestId("step-input-test-input"); - expect(input).toHaveAttribute("type", "text"); - }); -}); diff --git a/frontend/src/components/features/onboarding/information-request-form.tsx b/frontend/src/components/features/onboarding/information-request-form.tsx index 2c1e078c7c..3c0f43a7ab 100644 --- a/frontend/src/components/features/onboarding/information-request-form.tsx +++ b/frontend/src/components/features/onboarding/information-request-form.tsx @@ -6,7 +6,7 @@ import { Card } from "#/ui/card"; import { Text } from "#/ui/typography"; import { FormInput } from "./form-input"; import OpenHandsLogoWhite from "#/assets/branding/openhands-logo-white.svg?react"; -import CloudIcon from "#/icons/cloud.svg?react"; +import CloudIcon from "#/icons/cloud-minimal.svg?react"; import StackedIcon from "#/icons/stacked.svg?react"; export type RequestType = "saas" | "self-hosted"; @@ -143,7 +143,11 @@ export function InformationRequestForm({ /> {/* Buttons */} -
+