@@ -21,6 +21,8 @@ suite("RowViewModelFactory.buildRow() tests", () => {
2121 const sut = createFactory ( _contentPadCalculator . object ) ;
2222 const row = 1 ;
2323 const table = threeColumnTable ( ) ;
24+ _contentPadCalculator . setup ( _ => _ . getLeftPadding ( It . isAny ( ) , It . isAny ( ) , It . isAny ( ) ) ) . returns ( ( ) => "" ) ;
25+ _contentPadCalculator . setup ( _ => _ . getRightPadding ( It . isAny ( ) , It . isAny ( ) , It . isAny ( ) ) ) . returns ( ( ) => "" ) ;
2426
2527 sut . buildRow ( row , table ) ;
2628
@@ -37,22 +39,24 @@ suite("RowViewModelFactory.buildRow() tests", () => {
3739 const sut = createFactory ( _contentPadCalculator . object ) ;
3840 const row = 1 ;
3941 const table = threeColumnTable ( ) ;
40- _contentPadCalculator . setup ( _ => _ . getLeftPadding ( It . isAny ( ) , It . isAny ( ) , It . isAny ( ) ) ) . returns ( ( ) => "test" ) ;
42+ _contentPadCalculator . setup ( _ => _ . getLeftPadding ( It . isAny ( ) , It . isAny ( ) , It . isAny ( ) ) ) . returns ( ( ) => "test1" ) ;
43+ _contentPadCalculator . setup ( _ => _ . getRightPadding ( It . isAny ( ) , It . isAny ( ) , It . isAny ( ) ) ) . returns ( ( ) => "test2" ) ;
4144
4245 const rowViewModel = sut . buildRow ( row , table ) ;
4346
44- assert . strictEqual ( rowViewModel . getValueAt ( 1 ) . startsWith ( "test " ) , true ) ;
47+ assert . strictEqual ( rowViewModel . getValueAt ( 1 ) . startsWith ( "test1 " ) , true ) ;
4548 } ) ;
4649
4750 test ( "Value returned from padCalculator.getRightPadding is used to end the row value" , ( ) => {
4851 const sut = createFactory ( _contentPadCalculator . object ) ;
4952 const row = 1 ;
5053 const table = threeColumnTable ( ) ;
51- _contentPadCalculator . setup ( _ => _ . getRightPadding ( It . isAny ( ) , row , It . isAny ( ) ) ) . returns ( ( ) => "test" ) ;
54+ _contentPadCalculator . setup ( _ => _ . getLeftPadding ( It . isAny ( ) , row , It . isAny ( ) ) ) . returns ( ( ) => "test1" ) ;
55+ _contentPadCalculator . setup ( _ => _ . getRightPadding ( It . isAny ( ) , row , It . isAny ( ) ) ) . returns ( ( ) => "test2" ) ;
5256
5357 const rowViewModel = sut . buildRow ( row , table ) ;
5458
55- assert . strictEqual ( rowViewModel . getValueAt ( 1 ) . endsWith ( "test " ) , true ) ;
59+ assert . strictEqual ( rowViewModel . getValueAt ( 1 ) . endsWith ( "test2 " ) , true ) ;
5660 } ) ;
5761
5862 test ( "Empty middle column uses only left and right pad to create the value" , ( ) => {
@@ -77,12 +81,12 @@ suite("RowViewModelFactory.buildSeparator() tests", () => {
7781 _contentPadCalculator = Mock . ofType < PadCalculator > ( ) ;
7882 } ) ;
7983
80- test ( "Fills separator with dashes using the max length of the columns " , ( ) => {
84+ test ( "Fills separator with dashes using the max length of the displayWidths " , ( ) => {
8185 const sut = createFactory ( _contentPadCalculator . object ) ;
8286 const table = threeColumnTable ( ) ;
8387 const rows : RowViewModel [ ] = [
84- new RowViewModel ( [ "abc" , "defghi" ] , "\n" ) ,
85- new RowViewModel ( [ "abcd" , "efgh" ] , "\n" )
88+ new RowViewModel ( [ "abc" , "defghi" ] , [ 3 , 6 ] , "\n" ) ,
89+ new RowViewModel ( [ "abcd" , "efgh" ] , [ 4 , 4 ] , "\n" )
8690 ] ;
8791
8892 const separator = sut . buildSeparator ( rows , table ) ;
@@ -100,8 +104,8 @@ suite("RowViewModelFactory.buildSeparator() tests", () => {
100104 const sut = createFactory ( _contentPadCalculator . object , alignmentStrategy . object ) ;
101105 const table = threeColumnTable ( ) ;
102106 const rows : RowViewModel [ ] = [
103- new RowViewModel ( [ "abc" , "defghi" , "xyx" ] , "\n" ) ,
104- new RowViewModel ( [ "abcd" , "efgh" , "xyz" ] , "\n" )
107+ new RowViewModel ( [ "abc" , "defghi" , "xyx" ] , [ 3 , 6 , 3 ] , "\n" ) ,
108+ new RowViewModel ( [ "abcd" , "efgh" , "xyz" ] , [ 4 , 4 , 3 ] , "\n" )
105109 ] ;
106110
107111 sut . buildSeparator ( rows , table ) ;
0 commit comments