@@ -4,12 +4,14 @@ import {render, screen} from '@testing-library/react';
44
55import { testCustomClassName } from '../../../../test-utils/shared/common' ;
66import { qaIdByDefault } from '../../../components/Anchor/Anchor' ;
7- import { GridColumnSize } from '../../../grid' ;
7+ import { GridColumnSize , IndentValue } from '../../../grid' ;
88import { ClassNameProps , WithChildren } from '../../../models' ;
99import BlockBase , { BlockBaseFullProps } from '../BlockBase' ;
1010
1111const qa = 'block-base-component' ;
1212
13+ const indentValues : IndentValue [ ] = [ '0' , 'xs' , 's' , 'm' , 'l' , 'xl' ] ;
14+
1315type ComponentProps = WithChildren < BlockBaseFullProps & ClassNameProps > ;
1416
1517describe ( 'BlockBase' , ( ) => {
@@ -57,4 +59,24 @@ describe('BlockBase', () => {
5759 expect ( component ) . toBeInTheDocument ( ) ;
5860 expect ( component ) . toHaveAttribute ( 'id' , anchor . url ) ;
5961 } ) ;
62+
63+ test . each ( new Array < IndentValue > ( ...indentValues ) ) (
64+ 'render with given "%s" top indent' ,
65+ ( indentValue ) => {
66+ render ( < BlockBase qa = { qa } indent = { { top : indentValue } } /> ) ;
67+ const component = screen . getByTestId ( qa ) ;
68+
69+ expect ( component ) . toHaveClass ( `pc-block-base_indentTop_${ indentValue } ` ) ;
70+ } ,
71+ ) ;
72+
73+ test . each ( new Array < IndentValue > ( ...indentValues ) ) (
74+ 'render with given "%s" bottom indent' ,
75+ ( indentValue ) => {
76+ render ( < BlockBase qa = { qa } indent = { { bottom : indentValue } } /> ) ;
77+ const component = screen . getByTestId ( qa ) ;
78+
79+ expect ( component ) . toHaveClass ( `pc-block-base_indentBottom_${ indentValue } ` ) ;
80+ } ,
81+ ) ;
6082} ) ;
0 commit comments