Files
Gemini-Search/node_modules/react-day-picker/src/components/DayContent/DayContent.test.tsx
Ammaar Reshi d6025af146 Initial commit
2025-01-04 14:06:53 +00:00

38 lines
911 B
TypeScript

import { es } from 'date-fns/locale';
import { DayPickerProps } from 'DayPicker';
import { customRender } from 'test/render';
import { freezeBeforeAll } from 'test/utils';
import { DayContent, DayContentProps } from 'components/DayContent';
const today = new Date(2021, 8);
freezeBeforeAll(today);
let container: HTMLElement;
function setup(props: DayContentProps, dayPickerProps?: DayPickerProps) {
const view = customRender(<DayContent {...props} />, dayPickerProps);
container = view.container;
}
const date = today;
const displayMonth = today;
const props: DayContentProps = {
date: date,
displayMonth,
activeModifiers: {}
};
const dayPickerProps: DayPickerProps = {
locale: es
};
describe('when rendered', () => {
beforeEach(() => {
setup(props, dayPickerProps);
});
test('contains the formatted day', () => {
expect(container.firstChild).toHaveTextContent('1');
});
});