@@ -650,23 +650,6 @@ describe('PoTableComponent:', () => {
650650 expect ( component [ 'setTableOpacity' ] ) . toHaveBeenCalled ( ) ;
651651 } ) ) ;
652652
653- it ( 'should count columns for master detail' , ( ) => {
654- const columnManager = 1 ;
655- component . columns = [ ...columns ] ;
656-
657- const countColumns = columns . length + 1 + columnManager ;
658-
659- expect ( component . columnCountForMasterDetail ( ) ) . toBe ( countColumns ) ;
660-
661- component . actions = [ ...actions ] ;
662- fixture . detectChanges ( ) ;
663- expect ( component . columnCountForMasterDetail ( ) ) . toBe ( countColumns + 1 ) ;
664-
665- component . checkbox = true ;
666- fixture . detectChanges ( ) ;
667- expect ( component . columnCountForMasterDetail ( ) ) . toBe ( countColumns + 2 ) ;
668- } ) ;
669-
670653 it ( 'should calculate when height is a number in function calculateHeightTableContainer' , ( ) => {
671654 const fakeThis = {
672655 getHeightTableFooter : ( ) => 0 ,
@@ -1561,6 +1544,41 @@ describe('PoTableComponent:', () => {
15611544 expect ( spyDetectChanges ) . toHaveBeenCalled ( ) ;
15621545 } ) ;
15631546
1547+ it ( 'columnCountForMasterDetail: should return 7 columnCount if has actions and 5 columns' , ( ) => {
1548+ component . actions = [ ...singleAction ] ;
1549+ component . columns = [ ...columns ] ;
1550+
1551+ const columnCountAction = 1 ;
1552+
1553+ const countColumns = columns . length + 1 + columnCountAction ;
1554+
1555+ expect ( component . columnCountForMasterDetail ( ) ) . toBe ( countColumns ) ;
1556+ } ) ;
1557+
1558+ it ( 'columnCountForMasterDetail: should return 7 columnCount if actions is empty and has 5 columns' , ( ) => {
1559+ component . actions = [ ] ;
1560+ component . columns = [ ...columns ] ;
1561+
1562+ const columnCountColumnManager = 1 ;
1563+
1564+ const countColumns = columns . length + 1 + columnCountColumnManager ;
1565+
1566+ expect ( component . columnCountForMasterDetail ( ) ) . toBe ( countColumns ) ;
1567+ } ) ;
1568+
1569+ it ( 'columnCountForMasterDetail: should return 8 columnCount if actions is empty, has 5 columns and has checkbox' , ( ) => {
1570+ component . actions = [ ] ;
1571+ component . columns = [ ...columns ] ;
1572+ component . checkbox = true ;
1573+
1574+ const columnCountColumnManager = 1 ;
1575+ const columnCountCheckbox = 1 ;
1576+
1577+ const countColumns = columns . length + 1 + columnCountColumnManager + columnCountCheckbox ;
1578+
1579+ expect ( component . columnCountForMasterDetail ( ) ) . toBe ( countColumns ) ;
1580+ } ) ;
1581+
15641582 } ) ;
15651583
15661584 describe ( 'Templates:' , ( ) => {
0 commit comments