UNPKG

461 BPlain TextView Raw
1import { es } from "date-fns/locale/es";
2
3import { formatMonthDropdown } from "./formatMonthDropdown";
4
5const date = new Date(2022, 10, 21);
6
7test("should return the formatted month dropdown label", () => {
8 expect(formatMonthDropdown(date.getMonth())).toEqual("November");
9});
10
11describe("when a locale is passed in", () => {
12 test("should format using the locale", () => {
13 expect(formatMonthDropdown(date.getMonth(), es)).toEqual("noviembre");
14 });
15});