Rocky_Mountain_Vending/.pnpm-store/v10/files/38/050ff712659f3a8b458c72808cf2ad97b86f7bb35fd4c4df57d8474f464b04b74ce7dc7e87472563981318176946d8012fc8dc3715b80ceccda0d33004d60b
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

46 lines
1.2 KiB
Text

import { defaultDateLib } from "../classes/DateLib";
import { getFormatters } from "./getFormatters";
import { getYearOptions } from "./getYearOptions";
test("return undefined if navStart or navEnd are not set", () => {
const formatters = getFormatters({
formatYearDropdown: (date: Date) => `${date.getFullYear()}`
});
const result1 = getYearOptions(
undefined,
new Date(2022, 11, 31),
formatters,
defaultDateLib
);
const result2 = getYearOptions(
new Date(2022, 0, 1),
undefined,
formatters,
defaultDateLib
);
expect(result1).toBeUndefined();
expect(result2).toBeUndefined();
});
test("return correct dropdown options", () => {
const startMonth = new Date(2022, 0, 1); // January 2022
const endMonth = new Date(2024, 11, 31); // December 2024
const formatters = getFormatters({
formatYearDropdown: (date: Date) => `${date.getFullYear()}`
});
const result = getYearOptions(
startMonth,
endMonth,
formatters,
defaultDateLib
);
expect(result).toEqual([
{ value: 2022, label: "2022", disabled: false },
{ value: 2023, label: "2023", disabled: false },
{ value: 2024, label: "2024", disabled: false }
]);
});