shoc-frontend-new/src/test/app/(protected)/workorders/wizard-step-location-service.test.tsx
Arthur Bassi 61fbad7e1b fix(work-orders): stop sending customer on create
AccountId is resolved from Location on the server.
Create UI matches AAP: required Site, optional Service, no Account picker.
2026-08-25 22:26:01 -03:00

28 lines
1 KiB
TypeScript

import { render, screen } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
import { WizardStepLocationService } from "@/app/(protected)/workorders/_components/wizard/wizard-step-location-service";
import { EMPTY_WIZARD_DRAFT } from "@/domain/work-orders/types/work-order-wizard";
describe("WizardStepLocationService", () => {
it("requires Site, keeps Service optional, and does not render Account", () => {
render(
<WizardStepLocationService
draft={EMPTY_WIZARD_DRAFT}
locations={[]}
locationDetail={undefined}
services={[]}
svcOpen={false}
onSvcOpenChange={vi.fn()}
svcSearch=""
onSvcSearchChange={vi.fn()}
onUpdate={vi.fn()}
onPatch={vi.fn()}
/>,
);
expect(screen.getByText("Site")).toBeInTheDocument();
expect(screen.getByText("Service")).toBeInTheDocument();
expect(screen.queryByText("Account")).not.toBeInTheDocument();
expect(screen.queryByText(/Both are optional/i)).not.toBeInTheDocument();
});
});