@@ -541,7 +541,10 @@ describe('FoamcoreGrid', () => {
541
541
describe ( 'totalGridSize' , ( ) => {
542
542
beforeEach ( ( ) => {
543
543
props . collection . isSplitLevel = false
544
+ props . collection . isSplitLevelBottom = false
544
545
props . collection . max_row_index = 0
546
+ props . collection . lastInsertedRow = 0
547
+ props . collection . collection_cards = [ { id : '1' , maxRow : 1 } ]
545
548
props . uiStore . visibleRows = { min : 0 , max : 5 , num : 5 }
546
549
rerender ( )
547
550
} )
@@ -556,18 +559,19 @@ describe('FoamcoreGrid', () => {
556
559
expect ( height ) . toEqual ( calculatedHeight )
557
560
} )
558
561
559
- describe ( 'for split-level collections' , ( ) => {
562
+ describe ( 'for split-level collections, with canEdit true ' , ( ) => {
560
563
beforeEach ( ( ) => {
564
+ props . collection . canEdit = true
561
565
props . collection . isSplitLevel = true
562
566
rerender ( )
563
567
} )
564
568
565
- it ( 'should calculate the right height for non-split level collections ' , ( ) => {
569
+ it ( 'should calculate the right height' , ( ) => {
566
570
const { height } = component . totalGridSize
567
571
const { relativeZoomLevel } = component
568
572
const { gridSettings } = component
569
573
const { gridH, gutter } = gridSettings
570
- const maxRows = props . collection . max_row_index + 1
574
+ const maxRows = props . collection . max_row_index + 2
571
575
const calculatedHeight =
572
576
( ( gridH + gutter ) * maxRows ) / relativeZoomLevel
573
577
expect ( height ) . toEqual ( calculatedHeight )
@@ -581,7 +585,7 @@ describe('FoamcoreGrid', () => {
581
585
rerender ( )
582
586
} )
583
587
584
- it ( 'should calculate the right height for non-split level collections ' , ( ) => {
588
+ it ( 'should calculate the right height' , ( ) => {
585
589
const { height } = component . totalGridSize
586
590
const { relativeZoomLevel } = component
587
591
const { gridSettings } = component
0 commit comments