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