Rocky_Mountain_Vending/.pnpm-store/v10/files/16/5ca3ba43892d9459bde0415262fb222d7c590257cb23fce27cb98977538d0b740c08b9efa7df6232a5f69569c4d4401770f1cfe178e08b04942d1a1b2b2803
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

44 lines
1.1 KiB
Text

import { es } from "date-fns/locale/es";
import { DateLib, defaultDateLib } from "../classes/DateLib";
import { getWeekdays } from "./getWeekdays";
let result: Date[];
describe("when rendered without a locale", () => {
beforeEach(() => {
result = getWeekdays(defaultDateLib);
});
test("should return 7 days", () => {
expect(result).toHaveLength(7);
});
test("should return Sunday as first day", () => {
expect(result[0]).toBeSunday();
});
});
describe.each<0 | 1 | 2 | 3 | 4 | 5 | 6>([0, 1, 2, 3, 4, 5, 6])(
"when week start on %s",
(weekStartsOn) => {
beforeEach(() => {
result = getWeekdays(new DateLib({ locale: es, weekStartsOn }));
});
test("the first date should be weekStartsOn", () => {
expect(result[0].getDay()).toBe(weekStartsOn);
});
}
);
describe("when using ISO week", () => {
beforeEach(() => {
result = getWeekdays(
new DateLib({ locale: es, weekStartsOn: 3 }),
true,
undefined
);
});
test("should return Monday as first day", () => {
expect(result[0]).toBeMonday();
});
});