diff --git a/kafka-ui-react-app/src/components/common/PageLoader/PageLoader.tsx b/kafka-ui-react-app/src/components/common/PageLoader/PageLoader.tsx index 2f5932a4f8..98c70eb483 100644 --- a/kafka-ui-react-app/src/components/common/PageLoader/PageLoader.tsx +++ b/kafka-ui-react-app/src/components/common/PageLoader/PageLoader.tsx @@ -2,14 +2,14 @@ import React from 'react'; import cx from 'classnames'; interface Props { - isFullHeight: boolean; + fullHeight: boolean; } -const PageLoader: React.FC> = ({ isFullHeight = true }) => ( +const PageLoader: React.FC> = ({ fullHeight }) => (
{ it('matches the snapshot', () => { - const component = mount(); - expect(component).toMatchSnapshot(); + expect(mount()).toMatchSnapshot(); + }); + + it('renders half-height page loader by default', () => { + const wrapper = mount(); + expect(wrapper.exists('.hero.is-halfheight')).toBeTruthy(); + expect(wrapper.exists('.hero.is-fullheight-with-navbar')).toBeFalsy(); + }); + + it('renders fullheight page loader', () => { + const wrapper = mount(); + expect(wrapper.exists('.hero.is-halfheight')).toBeFalsy(); + expect(wrapper.exists('.hero.is-fullheight-with-navbar')).toBeTruthy(); }); }); diff --git a/kafka-ui-react-app/src/components/common/PageLoader/__tests__/__snapshots__/PageLoader.spec.tsx.snap b/kafka-ui-react-app/src/components/common/PageLoader/__tests__/__snapshots__/PageLoader.spec.tsx.snap index 10a9cf0631..34e9145f31 100644 --- a/kafka-ui-react-app/src/components/common/PageLoader/__tests__/__snapshots__/PageLoader.spec.tsx.snap +++ b/kafka-ui-react-app/src/components/common/PageLoader/__tests__/__snapshots__/PageLoader.spec.tsx.snap @@ -3,7 +3,7 @@ exports[`PageLoader matches the snapshot 1`] = `