File size: 520 Bytes
cf86710 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | import { DateLib } from "../classes/DateLib";
import { es } from "../locale/es.js";
import { formatMonthDropdown } from "./formatMonthDropdown";
const date = new Date(2022, 10, 21);
test("should return the formatted month dropdown label", () => {
expect(formatMonthDropdown(date)).toEqual("November");
});
describe("when a locale is passed in", () => {
test("should format using the locale", () => {
expect(formatMonthDropdown(date, new DateLib({ locale: es }))).toEqual(
"noviembre",
);
});
});
|