Compare commits

..

No commits in common. "8d44b1868c9c1448dfdefd216d37bc585c134e6d" and "b619b8ae136a27cc1dfa71a7fc09d0a98c1bb3cc" have entirely different histories.

8 changed files with 3 additions and 21 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 144 KiB

View file

@ -16,9 +16,6 @@ import {
} from "@/domain/vendors/use-cases/use-save-vendor-company-roster";
import { useVendorRosterResolver } from "./use-vendor-roster-resolver";
const VENDOR_ROSTER_NO_CHANGES_MESSAGE =
"No changes to save. Enter technician details or update a company field.";
const EDITABLE_COMPANY_FIELDS = [
"name",
"companyPhone",
@ -183,7 +180,7 @@ export function useVendorRosterForm({
if (mode === "create" && selection.selectedRoster != null) {
const selected = selection.selectedRoster;
if (!buildAdditiveRosterPatch(selected, values, selected.rowVersion, editedCompanyFields)) {
toast.error(VENDOR_ROSTER_NO_CHANGES_MESSAGE);
toast.error("Enter at least one technician to add to this vendor.");
return;
}
save.mutate(

View file

@ -358,7 +358,7 @@ function TechniciansFieldArray({
<Box>
<Stack direction="row" sx={{ alignItems: "center", justifyContent: "space-between" }}>
<Typography variant="subtitle2" className="font-semibold uppercase">
Technician details (optional)
Technicians ({fields.length})
</Typography>
<Button
size="small"

View file

@ -17,7 +17,6 @@ export function FlagCell({ color, disabled, onChange }: FlagCellProps) {
if (disabled) {
return (
<span
role="img"
className="flex h-[22px] w-[22px] items-center justify-center opacity-30"
aria-label={triggerName}
>

View file

@ -2,7 +2,6 @@ import { act, renderHook, waitFor } from "@testing-library/react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import type { ReactNode } from "react";
import { useController, useFieldArray } from "react-hook-form";
import { toast } from "react-toastify";
import { beforeEach, describe, expect, it, vi } from "vitest";
const rosterGet = vi.fn();
@ -429,7 +428,6 @@ describe("useVendorRosterForm additive add flow (SH-250)", () => {
beforeEach(() => {
rosterGet.mockReset();
saveMutate.mockReset();
vi.mocked(toast.error).mockReset();
});
it("issues an additive add — never update — when an existing company is selected", async () => {
@ -500,10 +498,6 @@ describe("useVendorRosterForm additive add flow (SH-250)", () => {
});
expect(saveMutate).not.toHaveBeenCalled();
expect(vi.mocked(toast.error)).toHaveBeenCalledTimes(1);
expect(vi.mocked(toast.error)).toHaveBeenCalledWith(
"No changes to save. Enter technician details or update a company field.",
);
});
it("keeps the entered technician and retries with the fresh rowVersion after reload", async () => {

View file

@ -75,14 +75,6 @@ describe("VendorCreateModal validation", () => {
);
});
it("labels the optional technician section without counting blank drafts", () => {
renderCreateModal();
expect(screen.getByText("Technician details (optional)")).toBeInTheDocument();
expect(screen.queryByText("Technicians (1)")).not.toBeInTheDocument();
expect(screen.getByRole("textbox", { name: "Technician name (optional)" })).toBeVisible();
});
it("labels the plain company field exactly, required, with no generated asterisk", () => {
renderWithProviders(<PlainCompanyFieldsHarness />, { route: "/vendors", withAuth: false });

View file

@ -34,7 +34,7 @@ describe("FlagCell", () => {
const onChange = vi.fn();
render(<FlagCell color="#EF4444" disabled onChange={onChange} />);
expect(screen.getByRole("img", { name: "Red flag" })).toBeInTheDocument();
expect(screen.getByLabelText("Red flag")).toBeInTheDocument();
expect(screen.queryByRole("button", { name: "Red flag" })).toBeNull();
expect(onChange).not.toHaveBeenCalled();
});