shoc-frontend-new/src/test/app/(protected)/workorders/wizard-step-location-service.test.tsx

29 lines
1 KiB
TypeScript
Raw Normal View History

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();
});
});