Rocky_Mountain_Vending/.pnpm-store/v10/files/ca/0299c8b23ebc45c0d6af101153b3711ef85338cf7767b3dc9fc1fe027ccc5022a25e223350bc41cd14aa85847f1bd566b1e7b8749d172d26a295d7b4ec2de2
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

77 lines
2 KiB
Text

import { defaultDateLib } from "../classes/DateLib";
import { getPreviousMonth } from "./getPreviousMonth";
it("should return undefined if navigation is disabled", () => {
const firstDisplayedMonth = new Date(2022, 0, 1); // January 2022
const calendarStartMonth = new Date(2022, 0, 1); // January 2022
const props = {
disableNavigation: true,
pagedNavigation: false,
numberOfMonths: 1
};
const result = getPreviousMonth(
firstDisplayedMonth,
calendarStartMonth,
props,
defaultDateLib
);
expect(result).toBeUndefined();
});
it("should return the previous month if startMonth is not provided", () => {
const firstDisplayedMonth = new Date(2022, 1, 1); // February 2022
const props = {
disableNavigation: false,
pagedNavigation: false,
numberOfMonths: 1
};
const result = getPreviousMonth(
firstDisplayedMonth,
undefined,
props,
defaultDateLib
);
expect(result).toEqual(new Date(2022, 0, 1)); // January 2022
});
it("should return undefined if the previous month is before the startMonth", () => {
const firstDisplayedMonth = new Date(2022, 0, 1); // January 2022
const calendarStartMonth = new Date(2022, 0, 1); // January 2022
const props = {
disableNavigation: false,
pagedNavigation: false,
numberOfMonths: 1
};
const result = getPreviousMonth(
firstDisplayedMonth,
calendarStartMonth,
props,
defaultDateLib
);
expect(result).toBeUndefined();
});
it("should return the correct previous month when pagedNavigation is true", () => {
const firstDisplayedMonth = new Date(2022, 2, 1); // March 2022
const calendarStartMonth = new Date(2022, 0, 1); // January 2022
const props = {
disableNavigation: false,
pagedNavigation: true,
numberOfMonths: 2,
startMonth: new Date(2022, 0, 1)
};
const result = getPreviousMonth(
firstDisplayedMonth,
calendarStartMonth,
props,
defaultDateLib
);
expect(result).toEqual(new Date(2022, 0, 1)); // January 2022
});