Rocky_Mountain_Vending/.pnpm-store/v10/files/5e/1af855d61d4cdca167a01cf769cc125eaeb79541f78f1bf994a0f6a58fa4e64f8fd2c985e1d1873838f482b984724fcf799c431e0e1566fa8c184fae76d7a6
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

99 lines
2.2 KiB
Text

import { CalendarDay } from "../classes";
import { defaultDateLib } from "../classes/DateLib";
import type { DayPickerProps, MoveFocusBy, MoveFocusDir } from "../types";
import { getNextFocus } from "./getNextFocus";
const props: Pick<
DayPickerProps,
"disabled" | "hidden" | "startMonth" | "endMonth"
> = {
disabled: [],
hidden: []
};
it("should return `undefined` if `attempt` exceeds 365", () => {
const focusedDay = new CalendarDay(
new Date(2020, 0, 1),
new Date(2020, 0, 1),
defaultDateLib
);
const moveBy: MoveFocusBy = "day";
const moveDir: MoveFocusDir = "after";
const result = getNextFocus(
moveBy,
moveDir,
focusedDay,
undefined,
undefined,
props,
defaultDateLib,
366
);
expect(result).toBeUndefined();
});
it("should return the focus date if it is not disabled or hidden", () => {
const focusedDay = new CalendarDay(
new Date(2020, 0, 1),
new Date(2020, 0, 1),
defaultDateLib
);
const expectedDate = new Date(2020, 0, 2);
const result = getNextFocus(
"day",
"after",
focusedDay,
undefined,
undefined,
props,
defaultDateLib
);
expect(result?.date).toEqual(expectedDate);
});
it("should return the next focus date if it is disabled", () => {
const focusedDay = new CalendarDay(
new Date(2020, 0, 1),
new Date(2020, 0, 1),
defaultDateLib
);
const disabledDate = new Date(2020, 0, 2);
const expectedDate = new Date(2020, 0, 3);
const result = getNextFocus(
"day",
"after",
focusedDay,
undefined,
undefined,
{
...props,
disabled: [disabledDate]
},
defaultDateLib
);
expect(result?.date).toEqual(expectedDate);
});
it("should return the next focus date if it is hidden", () => {
const focusedDay = new CalendarDay(
new Date(2020, 0, 1),
new Date(2020, 0, 1),
defaultDateLib
);
const hiddenDate = new Date(2020, 0, 2);
const expectedDate = new Date(2020, 0, 3);
const result = getNextFocus(
"day",
"after",
focusedDay,
undefined,
undefined,
{
...props,
hidden: [hiddenDate]
},
defaultDateLib
);
expect(result?.date).toEqual(expectedDate);
});