@@ -32,15 +32,15 @@ describe('getThinkingSpinnerLabel', () => {
3232} ) ;
3333
3434describe ( 'ThinkingComponent' , ( ) => {
35- it ( 'shows the live spinner header before thinking content ' , ( ) => {
35+ it ( 'shows only the live spinner header while collapsed ' , ( ) => {
3636 const component = new ThinkingComponent ( 'working it out' , true , 'live' ) ;
3737 const out = strip ( component . render ( 80 ) . join ( '\n' ) ) ;
3838 const label = formatThinkingSpinnerLabel ( ) ;
3939
4040 expect ( out ) . toContain ( `⠋ ${ label } ` ) ;
4141 expect ( out ) . not . toContain ( ` ⠋ ${ label } ` ) ;
4242 expect ( out ) . not . toContain ( `${ STATUS_BULLET } ⠋` ) ;
43- expect ( out ) . toContain ( ' working it out' ) ;
43+ expect ( out ) . not . toContain ( 'working it out' ) ;
4444 } ) ;
4545
4646 it ( 'uses the primary activity color while thinking is live' , ( ) => {
@@ -57,8 +57,9 @@ describe('ThinkingComponent', () => {
5757 }
5858 } ) ;
5959
60- it ( 'keeps live thinking height-limited to the tail' , ( ) => {
60+ it ( 'keeps expanded live thinking height-limited to the tail' , ( ) => {
6161 const component = new ThinkingComponent ( longThinking , true , 'live' ) ;
62+ component . setExpanded ( true ) ;
6263 const out = strip ( component . render ( 80 ) . join ( '\n' ) ) ;
6364
6465 expect ( out ) . not . toContain ( 'line1' ) ;
@@ -116,17 +117,12 @@ describe('ThinkingComponent', () => {
116117 }
117118 } ) ;
118119
119- it ( 'finalizes in place into a collapsed preview ' , ( ) => {
120+ it ( 'finalizes in place into nothing while collapsed ' , ( ) => {
120121 const component = new ThinkingComponent ( longThinking , true , 'live' ) ;
121122
122123 component . finalize ( ) ;
123124
124- const out = strip ( component . render ( 80 ) . join ( '\n' ) ) ;
125- expect ( out ) . toContain ( 'line1' ) ;
126- expect ( out ) . toContain ( 'line2' ) ;
127- expect ( out ) . not . toContain ( 'line3' ) ;
128- expect ( out ) . not . toContain ( 'line4' ) ;
129- expect ( out ) . toContain ( '... (5 more lines, ctrl+o to expand)' ) ;
125+ expect ( component . render ( 80 ) ) . toEqual ( [ ] ) ;
130126 } ) ;
131127
132128 it ( 'expands and collapses after finalization' , ( ) => {
@@ -135,18 +131,18 @@ describe('ThinkingComponent', () => {
135131
136132 component . setExpanded ( true ) ;
137133 const expanded = strip ( component . render ( 80 ) . join ( '\n' ) ) ;
134+ expect ( expanded ) . toContain ( 'line1' ) ;
138135 expect ( expanded ) . toContain ( 'line7' ) ;
139136 expect ( expanded ) . not . toContain ( 'ctrl+o to expand' ) ;
140137
141138 component . setExpanded ( false ) ;
142- const collapsed = strip ( component . render ( 80 ) . join ( '\n' ) ) ;
143- expect ( collapsed ) . not . toContain ( 'line7' ) ;
144- expect ( collapsed ) . toContain ( 'ctrl+o to expand' ) ;
139+ expect ( component . render ( 80 ) ) . toEqual ( [ ] ) ;
145140 } ) ;
146141
147- it ( 'keeps the finalized truncation footer within the requested render width' , ( ) => {
142+ it ( 'keeps expanded finalized lines within the requested render width' , ( ) => {
148143 const component = new ThinkingComponent ( longThinking , true , 'live' ) ;
149144 component . finalize ( ) ;
145+ component . setExpanded ( true ) ;
150146
151147 for ( const line of component . render ( 37 ) ) {
152148 expect ( visibleWidth ( line ) ) . toBeLessThanOrEqual ( 37 ) ;
0 commit comments