fix(vendors): remove duplicate company heading (#139)

* fix(vendors): remove duplicate company heading

* test(vendors): align detail baseline with CI

---------

Co-authored-by: Codex Review Integration <codex-review@local.invalid>
Co-authored-by: Adam Moussa <166072409+amoussa1229@users.noreply.github.com>
This commit is contained in:
Alexandre Brandizzi 2026-08-26 13:45:06 -03:00 • committed by GitHub
parent c29ec6b5d0
commit 338cc17b8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 30 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 115 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 }]),