@@ -319,6 +319,25 @@ describe('Billing payer scope', () => {
319319 )
320320 } )
321321
322+ it ( 'does not show a governing subscription description for a free personal workspace' , async ( ) => {
323+ mockPersonalQuery . current = {
324+ data : {
325+ success : true ,
326+ context : 'user' ,
327+ data : { ...PERSONAL_DATA , plan : 'free' , status : 'active' } ,
328+ } ,
329+ isLoading : false ,
330+ refetch : vi . fn ( ) ,
331+ }
332+
333+ await act ( async ( ) => {
334+ root . render ( < Billing scope = 'account' governingWorkspaceName = 'Free workspace' /> )
335+ } )
336+
337+ expect ( container . textContent ) . toContain ( 'Personal Free plan' )
338+ expect ( container . querySelector ( 'main > p' ) ) . toBeNull ( )
339+ } )
340+
322341 it ( 'renders an explicit free organization state without subscription controls' , async ( ) => {
323342 mockOrganizationQuery . current = {
324343 data : organizationResponse ( {
@@ -336,7 +355,13 @@ describe('Billing payer scope', () => {
336355 }
337356
338357 await act ( async ( ) => {
339- root . render ( < Billing scope = 'organization' organizationId = 'org-target' /> )
358+ root . render (
359+ < Billing
360+ scope = 'organization'
361+ organizationId = 'org-target'
362+ governingWorkspaceName = 'Free organization workspace'
363+ />
364+ )
340365 } )
341366
342367 expect ( container . textContent ) . toContain ( 'Organization Free plan' )
@@ -360,12 +385,19 @@ describe('Billing payer scope', () => {
360385 }
361386
362387 await act ( async ( ) => {
363- root . render ( < Billing scope = 'organization' organizationId = 'org-target' /> )
388+ root . render (
389+ < Billing
390+ scope = 'organization'
391+ organizationId = 'org-target'
392+ governingWorkspaceName = 'Lapsed organization workspace'
393+ />
394+ )
364395 } )
365396
366397 expect ( container . textContent ) . toContain ( 'Organization Max for Teams plan ended' )
367398 expect ( container . textContent ) . toContain ( 'Choose a new plan for this organization' )
368399 expect ( container . textContent ) . not . toContain ( 'Cancel subscription' )
400+ expect ( container . querySelector ( 'main > p' ) ) . toBeNull ( )
369401 expect (
370402 container . querySelector ( 'a[href="/workspace/organization-workspace/upgrade"]' ) ?. textContent
371403 ) . toBe ( 'Explore organization plans' )
0 commit comments