38 lines · 1.0 KB · TypeScript
RawDownload
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);  });});