v1.0 with SW PWA enabled

This commit is contained in:
Blomios
2026-01-01 17:40:53 +01:00
parent 1c0e22aac1
commit 3c8bebb2ad
29775 changed files with 2197201 additions and 119080 deletions

View File

@ -0,0 +1,47 @@
import { parseFromToProps } from 'contexts/DayPicker/utils';
describe('when "fromMonth" is passed in', () => {
const fromMonth = new Date(2021, 4, 3);
const expectedFromDate = new Date(2021, 4, 1);
const { fromDate } = parseFromToProps({ fromMonth });
test('"fromDate" should be the start of that month', () => {
expect(fromDate).toEqual(expectedFromDate);
});
describe('when "fromYear" is passed in', () => {
test('"fromDate" should be the start of that month', () => {
expect(fromDate).toEqual(expectedFromDate);
});
});
});
describe('when "fromYear" is passed in', () => {
const fromYear = 2021;
const expectedFromDate = new Date(2021, 0, 1);
const { fromDate } = parseFromToProps({ fromYear });
test('"fromDate" should be the start of that year', () => {
expect(fromDate).toEqual(expectedFromDate);
});
});
describe('when "toMonth" is passed in', () => {
const toMonth = new Date(2021, 4, 3);
const expectedToDate = new Date(2021, 4, 31);
const { toDate } = parseFromToProps({ toMonth });
test('"toDate" should be the end of that month', () => {
expect(toDate).toEqual(expectedToDate);
});
describe('when "fromYear" is passed in', () => {
test('"toDate" should be the end of that month', () => {
expect(toDate).toEqual(expectedToDate);
});
});
});
describe('when "toYear" is passed in', () => {
const toYear = 2021;
const expectedToDate = new Date(2021, 11, 31);
const { toDate } = parseFromToProps({ toYear });
test('"toDate" should be the end of that year', () => {
expect(toDate).toEqual(expectedToDate);
});
});