mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-07 16:19:01 +00:00
Compare commits
2 commits
c29ec6b5d0
...
f11e8a5d13
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f11e8a5d13 | ||
|
|
338cc17b8a |
4 changed files with 37 additions and 4 deletions
10
.github/workflows/ci.yaml
vendored
10
.github/workflows/ci.yaml
vendored
|
|
@ -1,16 +1,18 @@
|
|||
name: CI
|
||||
name: Frontend checks
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main, dev]
|
||||
push:
|
||||
branches: [main, dev]
|
||||
workflow_dispatch: {}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
build-and-test:
|
||||
name: Build and test
|
||||
# Org reusable workflow (Node 24): format check, lint, build, unit tests.
|
||||
uses: Sea-Haven-Industries/.github/.github/workflows/ci-typescript-frontend.yaml@main
|
||||
with:
|
||||
|
|
@ -28,9 +30,10 @@ jobs:
|
|||
# GOVERNANCE_BASE points the changed-file gate at the right diff:
|
||||
# PR -> the PR target branch (origin/<base_ref>)
|
||||
# push-> the previous commit on the branch (github.event.before)
|
||||
# manual -> dev, for exact-head recovery runs
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GOVERNANCE_BASE: ${{ github.event_name == 'pull_request' && format('origin/{0}', github.base_ref) || github.event.before }}
|
||||
GOVERNANCE_BASE: ${{ github.event_name == 'pull_request' && format('origin/{0}', github.base_ref) || github.event_name == 'push' && github.event.before || 'origin/dev' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
|
|
@ -43,6 +46,7 @@ jobs:
|
|||
- run: npm run verify
|
||||
|
||||
visual-regression:
|
||||
name: Visual regression
|
||||
runs-on: ubuntu-latest
|
||||
container: mcr.microsoft.com/playwright:v1.61.1-noble
|
||||
steps:
|
||||
|
|
|
|||
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