Rocky_Mountain_Vending/.pnpm-store/v10/files/86/ed4d5477bb565fbe2a2a0fb48328916e09f989292d1a369e36120fe65ac7c6c6d89bafaba5643d5539dfa51fc99b71c24d6181cc5450b4d1220423624a32d4
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.3 KiB
Text

import { addDays } from "date-fns/addDays";
import { DateRange } from "../types";
import { rangeIncludesDate } from "./rangeIncludesDate";
const date = new Date();
describe('when range is missing the "from" date', () => {
const range: DateRange = { from: undefined };
const result = rangeIncludesDate(range, date);
test("should return false", () => {
expect(result).toBe(false);
});
});
describe('when range is missing the "to" date', () => {
const result = rangeIncludesDate({ from: date, to: undefined }, date);
test("should return true", () => {
expect(result).toBe(true);
});
});
describe("when the range dates are the same as date", () => {
const range: DateRange = { from: date, to: date };
const result = rangeIncludesDate(range, date);
test("should return true", () => {
expect(result).toBe(true);
});
});
describe("when the range dates are the same but not as date", () => {
const range: DateRange = { from: date, to: date };
const result = rangeIncludesDate(range, addDays(date, 1));
test("should return false", () => {
expect(result).toBe(false);
});
});
describe("when the range is inverted", () => {
const range: DateRange = { from: addDays(date, 1), to: date };
const result = rangeIncludesDate(range, date);
test("should return true", () => {
expect(result).toBe(true);
});
});