@@ -8,9 +8,9 @@ import { default as assert } from 'assert';
88// Test the text truncation logic that should be applied to tree view button text
99describe ( 'CompareChangesTreeDataProvider text truncation' , ( ) => {
1010 const MAX_BUTTON_TEXT_LENGTH = 40 ; // Same constant used in implementation
11-
11+
1212 function truncateButtonText ( buttonText : string ) : string {
13- return buttonText . length > MAX_BUTTON_TEXT_LENGTH
13+ return buttonText . length > MAX_BUTTON_TEXT_LENGTH
1414 ? buttonText . substring ( 0 , MAX_BUTTON_TEXT_LENGTH - 3 ) + '...'
1515 : buttonText ;
1616 }
@@ -19,7 +19,7 @@ describe('CompareChangesTreeDataProvider text truncation', () => {
1919 it ( 'should truncate long button text with ellipsis' , ( ) => {
2020 const longButtonText = '$(sparkle) Very Long Copilot Reviewer Name That Would Cause Overflow Issues Code Review' ;
2121 const result = truncateButtonText ( longButtonText ) ;
22-
22+
2323 assert . strictEqual ( result . length , MAX_BUTTON_TEXT_LENGTH ) ;
2424 assert . ok ( result . endsWith ( '...' ) ) ;
2525 assert . ok ( result . includes ( '$(sparkle)' ) ) ;
@@ -29,23 +29,23 @@ describe('CompareChangesTreeDataProvider text truncation', () => {
2929 it ( 'should not truncate short button text' , ( ) => {
3030 const shortButtonText = '$(sparkle) Copilot Code Review' ;
3131 const result = truncateButtonText ( shortButtonText ) ;
32-
32+
3333 assert . strictEqual ( result , shortButtonText ) ;
3434 assert . ok ( ! result . includes ( '...' ) ) ;
3535 } ) ;
3636
3737 it ( 'should handle exactly max length text' , ( ) => {
3838 const exactLengthText = 'A' . repeat ( MAX_BUTTON_TEXT_LENGTH ) ;
3939 const result = truncateButtonText ( exactLengthText ) ;
40-
40+
4141 assert . strictEqual ( result , exactLengthText ) ;
4242 assert . ok ( ! result . includes ( '...' ) ) ;
4343 } ) ;
4444
4545 it ( 'should handle text that is one character over the limit' , ( ) => {
4646 const overLimitByOne = 'A' . repeat ( MAX_BUTTON_TEXT_LENGTH + 1 ) ;
4747 const result = truncateButtonText ( overLimitByOne ) ;
48-
48+
4949 assert . strictEqual ( result . length , MAX_BUTTON_TEXT_LENGTH ) ;
5050 assert . ok ( result . endsWith ( '...' ) ) ;
5151 assert . strictEqual ( result , 'A' . repeat ( MAX_BUTTON_TEXT_LENGTH - 3 ) + '...' ) ;
@@ -54,7 +54,7 @@ describe('CompareChangesTreeDataProvider text truncation', () => {
5454 it ( 'should preserve sparkle icon in truncated text' , ( ) => {
5555 const longTextWithIcon = '$(sparkle) ' + 'Very ' . repeat ( 20 ) + 'Long Code Review' ;
5656 const result = truncateButtonText ( longTextWithIcon ) ;
57-
57+
5858 assert . ok ( result . startsWith ( '$(sparkle)' ) ) ;
5959 assert . ok ( result . endsWith ( '...' ) ) ;
6060 assert . strictEqual ( result . length , MAX_BUTTON_TEXT_LENGTH ) ;
0 commit comments