File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ export const PlaidBlock: BlockConfig<PlaidResponse> = {
133133 serviceId : 'plaid' ,
134134 canonicalParamId : 'institutionId' ,
135135 placeholder : 'Search Plaid institutions' ,
136- dependsOn : [ 'credential' ] ,
136+ dependsOn : [ 'credential' , 'countryCodes' ] ,
137137 mode : 'basic' ,
138138 condition : {
139139 field : 'operation' ,
@@ -167,6 +167,7 @@ export const PlaidBlock: BlockConfig<PlaidResponse> = {
167167 title : 'Country Codes' ,
168168 type : 'short-input' ,
169169 placeholder : 'Comma-separated, defaults to US' ,
170+ value : ( ) => 'US' ,
170171 mode : 'advanced' ,
171172 condition : {
172173 field : 'operation' ,
Original file line number Diff line number Diff line change @@ -155,11 +155,16 @@ describe('PlaidBlock tools.config.params', () => {
155155 ) . toMatchObject ( {
156156 selectorKey : 'plaid.institutions' ,
157157 canonicalParamId : 'institutionId' ,
158- dependsOn : [ 'credential' ] ,
158+ dependsOn : [ 'credential' , 'countryCodes' ] ,
159159 } )
160160 expect (
161161 PlaidBlock . subBlocks . find ( ( subBlock ) => subBlock . id === 'manualInstitutionId' )
162162 ) . toMatchObject ( { canonicalParamId : 'institutionId' , mode : 'advanced' } )
163+ const countryCodes = PlaidBlock . subBlocks . find ( ( subBlock ) => subBlock . id === 'countryCodes' )
164+ expect ( typeof countryCodes ?. value ) . toBe ( 'function' )
165+ expect ( typeof countryCodes ?. value === 'function' ? countryCodes . value ( { } ) : undefined ) . toBe (
166+ 'US'
167+ )
163168 expect ( PlaidBlock . inputs ) . toHaveProperty ( 'oauthCredential' )
164169 expect ( PlaidBlock . inputs ) . toHaveProperty ( 'authAccountIds' )
165170 expect ( PlaidBlock . inputs ) . not . toHaveProperty ( 'plaidCredentialId' )
You can’t perform that action at this time.
0 commit comments