mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-05 00:12:09 +00:00
AccountId is resolved from Location on the server. Create UI matches AAP: required Site, optional Service, no Account picker.
28 lines
1 KiB
TypeScript
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();
|
|
});
|
|
});
|