fix(vendors): remove duplicate company heading

This commit is contained in:
Codex Review Integration 2026-08-26 10:53:50 -03:00
parent 48768cd8c3
commit 86ccf30694
3 changed files with 30 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 112 KiB

View file

@ -195,7 +195,6 @@ function DrawerBody({
return (
<Stack spacing={3} className="flex-1 overflow-y-auto" sx={{ p: 2.5 }}>
<Box>
<SectionTitle>Company</SectionTitle>
<CompanySection roster={roster} />
</Box>
<Divider />

View file

@ -313,6 +313,36 @@ describe("VendorDetailDrawer design parity", () => {
expect(screen.getAllByText("Gateway Plumbing").length).toBeGreaterThan(0);
});
it("shows exactly one Company label above the company value in view mode", () => {
useVendorCompanyRoster.mockReturnValue(
rosterWith([{ id: 1, contactName: "Adam", phone: "", isActive: true, totalJobs: 5 }]),
);
renderWithProviders(<VendorDetailDrawer open={true} vendor={vendor} onClose={vi.fn()} />, {
route: "/vendors",
withAuth: false,
});
expect(screen.getAllByText("Company")).toHaveLength(1);
expect(screen.getAllByText("Gateway Plumbing").length).toBeGreaterThan(0);
});
it("keeps the Notes section heading when notes exist", () => {
const roster = rosterWith([
{ id: 1, contactName: "Adam", phone: "", isActive: true, totalJobs: 5 },
]);
roster.data.notes = "Preferred after-hours vendor";
useVendorCompanyRoster.mockReturnValue(roster);
renderWithProviders(<VendorDetailDrawer open={true} vendor={vendor} onClose={vi.fn()} />, {
route: "/vendors",
withAuth: false,
});
expect(screen.getByText("Notes")).toBeInTheDocument();
expect(screen.getByText("Preferred after-hours vendor")).toBeInTheDocument();
});
it("labels the Google Maps field below Address even when no URL is stored", () => {
useVendorCompanyRoster.mockReturnValue(
rosterWith([{ id: 1, contactName: "Adam", phone: "", isActive: true, totalJobs: 5 }]),