File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -264,6 +264,7 @@ const OnboardingWithProps = ({
264264 employmentId = { employmentId }
265265 externalId = { externalId }
266266 options = { {
267+ features : [ 'onboarding_reserves' ] ,
267268 jsonSchemaVersionByCountry : {
268269 DEU : {
269270 contract_details : 1 ,
Original file line number Diff line number Diff line change @@ -213,9 +213,10 @@ export const useOnboarding = ({
213213 refetch : refetchCompany ,
214214 } = useCompany ( companyId ) ;
215215
216- // TODO: remove this once the onboarding reserves are enabled, change this to stepState.currentStep.name === 'review'
217- // TODO: Go to src/flows/Onboarding/tests/OnboardingInvite.test.tsx and unskip test should render "Create Reserve" button when onboardingReservesStatus is deposit_required
218- const isOnboardingReservesEnabled = false ;
216+ const isOnboardingReservesEnabled =
217+ ( options ?. features ?. includes ( 'onboarding_reserves' ) &&
218+ stepState . currentStep . name === 'review' ) ||
219+ false ;
219220
220221 const { data : onboardingReservesStatus } =
221222 useEmploymentOnboardingReservesStatus (
Original file line number Diff line number Diff line change @@ -630,8 +630,7 @@ describe('OnboardingInvite', () => {
630630 } ) ;
631631 } ) ;
632632
633- // TODO: unskip this test once the onboarding reserves are enabled
634- it . skip ( 'should render "Create Reserve" button when onboardingReservesStatus is deposit_required' , async ( ) => {
633+ it ( 'should render "Create Reserve" button when onboardingReservesStatus is deposit_required' , async ( ) => {
635634 let onboardingBagRef : OnboardingRenderProps [ 'onboardingBag' ] | null = null ;
636635
637636 const testRender = ( {
@@ -685,6 +684,9 @@ describe('OnboardingInvite', () => {
685684 { ...defaultProps }
686685 skipSteps = { [ 'select_country' ] }
687686 render = { testRender }
687+ options = { {
688+ features : [ 'onboarding_reserves' ] ,
689+ } }
688690 /> ,
689691 { wrapper : TestProviders } ,
690692 ) ;
Original file line number Diff line number Diff line change @@ -49,6 +49,8 @@ export type OnboardingRenderProps = {
4949 } ;
5050} ;
5151
52+ type OnboardingFeatures = 'onboarding_reserves' ;
53+
5254export type OnboardingFlowProps = {
5355 /**
5456 * The country code to use for the onboarding.
@@ -102,6 +104,12 @@ export type OnboardingFlowProps = {
102104 contract_details ?: number | 'latest' ;
103105 } ;
104106 } ;
107+ /**
108+ * The features to use for the onboarding.
109+ * This is used to enable or disable features for the onboarding.
110+ * Currently only supports enabling the onboarding reserves feature.
111+ */
112+ features ?: OnboardingFeatures [ ] ;
105113 } ;
106114 /**
107115 * The render prop function with the params passed by the useOnboarding hook and the components available to use for this flow
You can’t perform that action at this time.
0 commit comments