import { describe, expect, it } from "vitest"; import { resolveKeyboardShift } from "./keyboard-shift-policy"; describe("resolveKeyboardShift", () => { it("keeps the existing open-keyboard offset behavior", () => { expect( resolveKeyboardShift({ rawKeyboardHeight: 320, keyboardProgress: 1, bottomInset: 24, isIos: false, iosMinHeight: 120, }), ).toBe(296); }); it("treats progress zero as closed even when Android reports a stale height", () => { expect( resolveKeyboardShift({ rawKeyboardHeight: 320, keyboardProgress: 0, bottomInset: 24, isIos: false, iosMinHeight: 120, }), ).toBe(0); }); it("still ignores small iOS accessory bar reports", () => { expect( resolveKeyboardShift({ rawKeyboardHeight: 80, keyboardProgress: 1, bottomInset: 0, isIos: true, iosMinHeight: 120, }), ).toBe(0); }); });