Co-authored-by: codex <[email protected]> Co-authored-by: Thuong Tin <[email protected]> Co-authored-by: Kapish14 <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]>
39 lines
1.0 KiB
TypeScript
39 lines
1.0 KiB
TypeScript
import { describe, expect, it } from "vite-plus/test";
|
|
|
|
import { derivePendingUserInputMaxHeight } from "./pendingUserInputLayout";
|
|
|
|
describe("derivePendingUserInputMaxHeight", () => {
|
|
it("caps a tall portrait viewport", () => {
|
|
expect(
|
|
derivePendingUserInputMaxHeight({
|
|
windowHeight: 932,
|
|
keyboardHeight: 0,
|
|
navigationHeaderHeight: 103,
|
|
composerOverlapHeight: 94,
|
|
}),
|
|
).toBe(560);
|
|
});
|
|
|
|
it("subtracts the keyboard while editing a custom answer", () => {
|
|
expect(
|
|
derivePendingUserInputMaxHeight({
|
|
windowHeight: 932,
|
|
keyboardHeight: 336,
|
|
navigationHeaderHeight: 103,
|
|
composerOverlapHeight: 94,
|
|
}),
|
|
).toBe(387);
|
|
});
|
|
|
|
it("keeps the fixed action area usable in a short keyboard-open viewport", () => {
|
|
expect(
|
|
derivePendingUserInputMaxHeight({
|
|
windowHeight: 375,
|
|
keyboardHeight: 240,
|
|
navigationHeaderHeight: 44,
|
|
composerOverlapHeight: 94,
|
|
}),
|
|
).toBe(160);
|
|
});
|
|
});
|