diff --git a/packages/calendar/src/Component.test.tsx b/packages/calendar/src/Component.test.tsx index 65e6bddfca..d89e3f205e 100644 --- a/packages/calendar/src/Component.test.tsx +++ b/packages/calendar/src/Component.test.tsx @@ -41,12 +41,15 @@ describe('Calendar', () => { ).toMatchSnapshot(); }); - it.each(['month-only', 'full'])('should match selectorView="%s" snapshot', view => { - expect( - render() - .container, - ).toMatchSnapshot(); - }); + it.each(['month-only', 'full', 'empty'])( + 'should match selectorView="%s" snapshot', + view => { + expect( + render() + .container, + ).toMatchSnapshot(); + }, + ); }); it('should set `data-test-id` attribute', () => { diff --git a/packages/calendar/src/Component.tsx b/packages/calendar/src/Component.tsx index b171f99a56..30356b8398 100644 --- a/packages/calendar/src/Component.tsx +++ b/packages/calendar/src/Component.tsx @@ -28,7 +28,7 @@ export type CalendarProps = { defaultView?: View; /** - * Вид шапки — месяц и год или только месяц + * Вид шапки — месяц и год или только месяц или без шапки */ selectorView?: SelectorView; @@ -253,27 +253,29 @@ export const Calendar = forwardRef( })} data-test-id={dataTestId} > -
- {selectorView === 'month-only' ? ( - - ) : ( - - )} -
+ {selectorView !== 'empty' && ( +
+ {selectorView === 'month-only' ? ( + + ) : ( + + )} +
+ )}
{view === 'days' && ( diff --git a/packages/calendar/src/__snapshots__/Component.test.tsx.snap b/packages/calendar/src/__snapshots__/Component.test.tsx.snap index ea04050bc7..c6cb8e3090 100644 --- a/packages/calendar/src/__snapshots__/Component.test.tsx.snap +++ b/packages/calendar/src/__snapshots__/Component.test.tsx.snap @@ -2280,6 +2280,599 @@ exports[`Calendar Display tests should match defaultView="years" snapshot 1`] =
`; +exports[`Calendar Display tests should match selectorView="empty" snapshot 1`] = ` +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Пн + + Вт + + Ср + + Чт + + Пт + + Сб + + Вс +
+ + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + +
+
+
+
+`; + exports[`Calendar Display tests should match selectorView="full" snapshot 1`] = `