mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-09-30 10:23:11 +00:00
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:
parent
c29ec6b5d0
commit
338cc17b8a
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 |
|
|
@ -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 />
|
||||
|
|
|
|||
|
|
@ -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 }]),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue