fix: T4a browser check findings
- Withdrawal wording from one backend helper everywhere ("bis
einschließlich TT.MM. – ab TT.MM. wieder erntefähig", year when it
crosses New Year); withdrawal-status returns lastBlockedDay and the
ready text, the frontend no longer computes dates
- Calendar events name colony or apiary, withdrawal events carry
product and detail; compact withdrawal rows on mobile
- One bottling warning per colony and treatment; pre-save hint
- Offline: online-only actions disabled with a reason, cached data
shows its timestamp, open sheets block submit offline
- Mobile: no horizontal scroll at 360 px, touch targets >= 44 px,
toasts and the add button no longer cover content
- Cleanup sheet without destructive preselection; natural sort of
colony codes; collapsible automation rule cards; varroa list newest
first with chart axes; text fixes
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
32c61c8e14
commit
c2f71bcb03
101 files changed
+2189
-271
No files matched your search
@@ -7,12 +7,14 @@ import { finishHandOvers, purgeStaleDraftPhotos } from "@/lib/photos/store";
|
||||
import AppLayout from "./layout";
|
||||
|
||||
const pushMock = vi.fn();
|
||||
let pathname = "/inspections/new";
|
||||
vi.mock("next/navigation", () => ({
|
||||
useRouter: () => ({ replace: vi.fn(), push: pushMock }),
|
||||
usePathname: () => "/inspections/new",
|
||||
usePathname: () => pathname,
|
||||
}));
|
||||
|
||||
let sessionMode: "online" | "offline" = "online";
|
||||
let permissions: string[] = [];
|
||||
|
||||
vi.mock("@/lib/auth/auth-context", () => ({
|
||||
useAuth: () => ({
|
||||
@@ -22,7 +24,7 @@ vi.mock("@/lib/auth/auth-context", () => ({
|
||||
name: "Test Imker",
|
||||
roleKey: "admin",
|
||||
roleName: "Admin",
|
||||
permissions: [],
|
||||
permissions,
|
||||
mfaEnabled: false,
|
||||
hasAvatar: false,
|
||||
},
|
||||
@@ -91,9 +93,51 @@ function expectNoScrollContainerAbove(element: HTMLElement) {
|
||||
describe("AppLayout", () => {
|
||||
beforeEach(() => {
|
||||
sessionMode = "online";
|
||||
pathname = "/inspections/new";
|
||||
permissions = [];
|
||||
pushMock.mockClear();
|
||||
});
|
||||
|
||||
it("leaves room under the page for the quick-add button on a phone, so it covers no action", () => {
|
||||
pathname = "/suggestions";
|
||||
permissions = ["inspections:create"];
|
||||
render(
|
||||
<AppLayout>
|
||||
<p>Seiteninhalt</p>
|
||||
</AppLayout>,
|
||||
);
|
||||
|
||||
const content = screen.getByText("Seiteninhalt").closest("[tabindex='-1']") as HTMLElement;
|
||||
// FAB top edge = nav + 1rem gap + 3rem button = nav + 4rem; padding nav + 4.5rem leaves 0.5rem free
|
||||
// below the last button of the page, so the FAB never covers it at the end of the scroll.
|
||||
expect(content.className).toContain("pb-[calc(var(--bottom-nav-height)+--spacing(18))]");
|
||||
expect(18 * 0.25).toBeGreaterThan(1 + 3);
|
||||
});
|
||||
|
||||
it("adds no extra room on a form page (the quick-add button is hidden there) or without the button", () => {
|
||||
permissions = ["inspections:create"];
|
||||
const { unmount } = render(
|
||||
<AppLayout>
|
||||
<p>Seiteninhalt</p>
|
||||
</AppLayout>,
|
||||
);
|
||||
expect(screen.getByText("Seiteninhalt").closest("[tabindex='-1']")?.className).not.toContain(
|
||||
"--spacing(18)",
|
||||
);
|
||||
unmount();
|
||||
|
||||
pathname = "/suggestions";
|
||||
permissions = [];
|
||||
render(
|
||||
<AppLayout>
|
||||
<p>Seiteninhalt</p>
|
||||
</AppLayout>,
|
||||
);
|
||||
expect(screen.getByText("Seiteninhalt").closest("[tabindex='-1']")?.className).not.toContain(
|
||||
"--spacing(18)",
|
||||
);
|
||||
});
|
||||
|
||||
it("shows the offline band for the signed-in user right below the header", () => {
|
||||
render(
|
||||
<AppLayout>
|
||||
|
||||
Reference in new issue
Block a user