File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed
testsUtils/sharedScenarios/table Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -30,13 +30,11 @@ const pathsDelete = [
3030 './src/pages/Home/Galleries' ,
3131 './src/assets' ,
3232 './src/shared/testsUtils/clearString.ts' ,
33- './src/shared/toolkit.ts' ,
3433 './src/shared/components/LiveCode' ,
3534 './src/shared/components/Cards' ,
3635 './src/shared/components/LazyImage' ,
3736 './src/shared/components/DownloadLink' ,
3837 './src/shared/components/Editor' ,
39- './src/shared/components/testsUtils/clearString.ts' ,
4038 './src/pages/Demos' ,
4139 './features/Demos' ,
4240 'renovate.json' ,
Original file line number Diff line number Diff line change @@ -16,4 +16,18 @@ describe('Header', () => {
1616 within ( baseElement ) . getByRole ( scope === 'col' || scope === undefined ? 'columnheader' : 'rowheader' ) ;
1717 screen . getByText ( 'label' ) ;
1818 } ) ;
19+
20+ it ( 'Should render Header with class "af-table__th--blank" when isBlank is true' , ( ) => {
21+ const { baseElement } = renderWithContainer ( < Header isBlank /> , container ) ;
22+
23+ const header = within ( baseElement ) . getByRole ( 'columnheader' ) ;
24+ expect ( header ) . toHaveClass ( 'af-table__th af-table__th--blank' ) ;
25+ } ) ;
26+
27+ it ( 'Should render Header without class "af-table__th--blank" when isBlank is false' , ( ) => {
28+ const { baseElement } = renderWithContainer ( < Header isBlank = { false } /> , container ) ;
29+
30+ const header = within ( baseElement ) . getByRole ( 'columnheader' ) ;
31+ expect ( header ) . toHaveClass ( 'af-table__th' ) ;
32+ } ) ;
1933} ) ;
Original file line number Diff line number Diff line change @@ -43,7 +43,10 @@ export const expectTable = async (tableItemsType = DEFAULT_TABLE_ITEMS_TYPE) =>
4343} ;
4444
4545export const expectCellsContent = ( cells : HTMLElement [ ] , ...args : string [ ] ) => {
46- args
46+ const argsWithoutLast = [ ...args ] ;
47+ argsWithoutLast . pop ( ) ;
48+
49+ argsWithoutLast
4750 . filter ( item => ! isNull ( item ) )
4851 . forEach ( ( headerLabel , index ) => {
4952 expect ( cells [ index ] ) . toHaveTextContent ( RegExp ( headerLabel ) ) ;
You can’t perform that action at this time.
0 commit comments