40 remove self billing feature flag (#4379)
* Define quantity at checkout * Remove billing submenu when not isBillingEnabled * Remove feature flag * Log warning when missing subscription active workspace add or remove member * Display subscribe cta for free usage of twenty * Authorize all settings when subscription canceled or unpaid * Display subscribe cta for workspace with canceled subscription * Replace OneToOne by OneToMany * Add a currentBillingSubscriptionField * Handle multiple subscriptions by workspace * Fix redirection * Fix test * Fix billingState
This commit is contained in:
@ -21,6 +21,9 @@ const currentWorkspace = {
|
||||
activationStatus: 'active',
|
||||
id: '1',
|
||||
allowImpersonation: true,
|
||||
currentBillingSubscription: {
|
||||
status: 'trialing',
|
||||
},
|
||||
};
|
||||
const currentWorkspaceMember = {
|
||||
id: '1',
|
||||
@ -240,4 +243,35 @@ describe('useOnboardingStatus', () => {
|
||||
|
||||
expect(result.current.onboardingStatus).toBe('unpaid');
|
||||
});
|
||||
|
||||
it('should return "completed_without_subscription"', async () => {
|
||||
const { result } = renderHooks();
|
||||
const {
|
||||
setTokenPair,
|
||||
setBilling,
|
||||
setCurrentWorkspace,
|
||||
setCurrentWorkspaceMember,
|
||||
} = result.current;
|
||||
|
||||
act(() => {
|
||||
setTokenPair(tokenPair);
|
||||
setBilling(billing);
|
||||
setCurrentWorkspace({
|
||||
...currentWorkspace,
|
||||
subscriptionStatus: 'trialing',
|
||||
currentBillingSubscription: null,
|
||||
});
|
||||
setCurrentWorkspaceMember({
|
||||
...currentWorkspaceMember,
|
||||
name: {
|
||||
firstName: 'John',
|
||||
lastName: 'Doe',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
expect(result.current.onboardingStatus).toBe(
|
||||
'completed_without_subscription',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user