@@ -19,15 +19,15 @@ const DEFAULT_BILLING_STATUS: BillingStatusResponse = {
1919
2020const {
2121 mockTeamWorkspacesEnabled,
22- mockConsolidatedBillingEnabled ,
22+ mockBillingControlEnabled ,
2323 mockIsPersonal,
2424 mockPlans,
2525 mockPurchaseCredits,
2626 mockUpdateActiveWorkspace,
2727 mockBillingStatus
2828} = vi . hoisted ( ( ) => ( {
2929 mockTeamWorkspacesEnabled : { value : false } ,
30- mockConsolidatedBillingEnabled : { value : false } ,
30+ mockBillingControlEnabled : { value : false } ,
3131 mockIsPersonal : { value : true } ,
3232 mockPlans : { value : [ ] as Plan [ ] } ,
3333 mockPurchaseCredits : vi . fn ( ) ,
@@ -59,13 +59,11 @@ vi.mock('@/composables/useFeatureFlags', async () => {
5959 teamWorkspacesEnabledRef . value = value
6060 }
6161 } )
62- const consolidatedBillingEnabledRef = ref (
63- mockConsolidatedBillingEnabled . value
64- )
65- Object . defineProperty ( mockConsolidatedBillingEnabled , 'value' , {
66- get : ( ) => consolidatedBillingEnabledRef . value ,
62+ const billingControlEnabledRef = ref ( mockBillingControlEnabled . value )
63+ Object . defineProperty ( mockBillingControlEnabled , 'value' , {
64+ get : ( ) => billingControlEnabledRef . value ,
6765 set : ( value : boolean ) => {
68- consolidatedBillingEnabledRef . value = value
66+ billingControlEnabledRef . value = value
6967 }
7068 } )
7169 return {
@@ -74,8 +72,8 @@ vi.mock('@/composables/useFeatureFlags', async () => {
7472 get teamWorkspacesEnabled ( ) {
7573 return mockTeamWorkspacesEnabled . value
7674 } ,
77- get consolidatedBillingEnabled ( ) {
78- return mockConsolidatedBillingEnabled . value
75+ get billingControlEnabled ( ) {
76+ return mockBillingControlEnabled . value
7977 }
8078 }
8179 } )
@@ -165,7 +163,7 @@ describe('useBillingContext', () => {
165163 setActivePinia ( createPinia ( ) )
166164 vi . clearAllMocks ( )
167165 mockTeamWorkspacesEnabled . value = false
168- mockConsolidatedBillingEnabled . value = false
166+ mockBillingControlEnabled . value = false
169167 mockIsPersonal . value = true
170168 mockPlans . value = [ ]
171169 mockBillingStatus . value = { ...DEFAULT_BILLING_STATUS }
@@ -177,27 +175,27 @@ describe('useBillingContext', () => {
177175 expect ( type . value ) . toBe ( 'legacy' )
178176 } )
179177
180- it ( 'keeps personal on legacy when consolidated billing is disabled' , ( ) => {
178+ it ( 'keeps personal on legacy when billing control is disabled' , ( ) => {
181179 mockTeamWorkspacesEnabled . value = true
182- mockConsolidatedBillingEnabled . value = false
180+ mockBillingControlEnabled . value = false
183181 mockIsPersonal . value = true
184182
185183 const { type } = useBillingContext ( )
186184 expect ( type . value ) . toBe ( 'legacy' )
187185 } )
188186
189- it ( 'selects workspace type for personal when consolidated billing is enabled' , ( ) => {
187+ it ( 'selects workspace type for personal when billing control is enabled' , ( ) => {
190188 mockTeamWorkspacesEnabled . value = true
191- mockConsolidatedBillingEnabled . value = true
189+ mockBillingControlEnabled . value = true
192190 mockIsPersonal . value = true
193191
194192 const { type } = useBillingContext ( )
195193 expect ( type . value ) . toBe ( 'workspace' )
196194 } )
197195
198- it ( 'selects workspace type for team regardless of consolidated billing' , ( ) => {
196+ it ( 'selects workspace type for team regardless of billing control ' , ( ) => {
199197 mockTeamWorkspacesEnabled . value = true
200- mockConsolidatedBillingEnabled . value = false
198+ mockBillingControlEnabled . value = false
201199 mockIsPersonal . value = false
202200
203201 const { type } = useBillingContext ( )
@@ -298,7 +296,7 @@ describe('useBillingContext', () => {
298296 expect ( workspaceApi . getBillingStatus ) . not . toHaveBeenCalled ( )
299297
300298 // Authenticated remote config resolves the flag on for the same workspace
301- mockConsolidatedBillingEnabled . value = true
299+ mockBillingControlEnabled . value = true
302300 mockTeamWorkspacesEnabled . value = true
303301
304302 await vi . waitFor ( ( ) => {
@@ -307,16 +305,16 @@ describe('useBillingContext', () => {
307305 } )
308306 } )
309307
310- it ( 'moves a personal workspace to workspace billing when consolidated billing flips on' , async ( ) => {
308+ it ( 'moves a personal workspace to workspace billing when billing control flips on' , async ( ) => {
311309 mockTeamWorkspacesEnabled . value = true
312- mockConsolidatedBillingEnabled . value = false
310+ mockBillingControlEnabled . value = false
313311 mockIsPersonal . value = true
314312
315313 const { type } = useBillingContext ( )
316314 await nextTick ( )
317315 expect ( type . value ) . toBe ( 'legacy' )
318316
319- mockConsolidatedBillingEnabled . value = true
317+ mockBillingControlEnabled . value = true
320318
321319 await vi . waitFor ( ( ) => {
322320 expect ( type . value ) . toBe ( 'workspace' )
@@ -325,9 +323,9 @@ describe('useBillingContext', () => {
325323 } )
326324
327325 describe ( 'subscription mirror to workspace store' , ( ) => {
328- it ( 'mirrors subscription for personal workspaces on the consolidated billing flow' , async ( ) => {
326+ it ( 'mirrors subscription for personal workspaces on the billing control flow' , async ( ) => {
329327 mockTeamWorkspacesEnabled . value = true
330- mockConsolidatedBillingEnabled . value = true
328+ mockBillingControlEnabled . value = true
331329 mockIsPersonal . value = true
332330
333331 const { initialize } = useBillingContext ( )
@@ -584,7 +582,7 @@ describe('useBillingContext', () => {
584582
585583 it ( 'is true for a per-credit Team plan in a personal workspace before its credit stop is populated' , async ( ) => {
586584 mockTeamWorkspacesEnabled . value = true
587- mockConsolidatedBillingEnabled . value = true
585+ mockBillingControlEnabled . value = true
588586 mockIsPersonal . value = true
589587 mockBillingStatus . value = {
590588 is_active : true ,
0 commit comments