offPeakMenuHintPlacement.test.ts 664 B

12345678910111213141516
  1. import { describe, expect, it } from "vitest";
  2. import { resolveOffPeakMenuHintSide } from "@/settings/OffPeakTaskList.js";
  3. describe("resolveOffPeakMenuHintSide", () => {
  4. it("keeps the menu hint on the right when the viewport has enough room", () => {
  5. expect(resolveOffPeakMenuHintSide({ right: 800 }, 1200)).toBe("right");
  6. });
  7. it("moves the menu hint above the trigger when right-side room is insufficient", () => {
  8. expect(resolveOffPeakMenuHintSide({ right: 760 }, 960)).toBe("top");
  9. });
  10. it("uses the non-overlapping fallback before the trigger is measurable", () => {
  11. expect(resolveOffPeakMenuHintSide(null, 960)).toBe("top");
  12. });
  13. });