Fix compact sheet bottom spacing

This commit is contained in:
Mohamed Boudra
2026-06-04 09:28:05 +07:00
parent f3b7dac768
commit 3e3e944cf4
5 changed files with 112 additions and 5 deletions
@@ -0,0 +1,40 @@
import { describe, expect, it } from "vitest";
import { getCompactSheetSafeAreaPadding } from "@/components/adaptive-modal-sheet-layout";
describe("getCompactSheetSafeAreaPadding", () => {
it("adds the bottom inset to compact sheet footers", () => {
expect(
getCompactSheetSafeAreaPadding({
isCompact: true,
hasFooter: true,
baseContentPadding: 24,
baseFooterPadding: 12,
safeAreaBottom: 34,
}),
).toEqual({ footerPaddingBottom: 46 });
});
it("adds the bottom inset to compact sheet content when there is no footer", () => {
expect(
getCompactSheetSafeAreaPadding({
isCompact: true,
hasFooter: false,
baseContentPadding: 24,
baseFooterPadding: 12,
safeAreaBottom: 34,
}),
).toEqual({ contentPaddingBottom: 58 });
});
it("does not inset desktop sheets", () => {
expect(
getCompactSheetSafeAreaPadding({
isCompact: false,
hasFooter: false,
baseContentPadding: 24,
baseFooterPadding: 12,
safeAreaBottom: 34,
}),
).toEqual({});
});
});