@@ -8,7 +8,6 @@ import { useConfig } from 'wagmi';
8
8
import { mock } from 'wagmi/connectors' ;
9
9
import { setOnchainKitConfig } from './OnchainKitConfig' ;
10
10
import { OnchainKitProvider } from './OnchainKitProvider' ;
11
- import { COINBASE_VERIFIED_ACCOUNT_SCHEMA_ID } from './identity/constants' ;
12
11
import type { EASSchemaUid } from './identity/types' ;
13
12
import { useOnchainKit } from './useOnchainKit' ;
14
13
import { useProviderDependencies } from './useProviderDependencies' ;
@@ -184,6 +183,11 @@ describe('OnchainKitProvider', () => {
184
183
theme : 'default' ,
185
184
} ,
186
185
paymaster : paymasterUrl ,
186
+ wallet : {
187
+ display : 'classic' ,
188
+ termsUrl : undefined ,
189
+ privacyUrl : undefined ,
190
+ } ,
187
191
} ,
188
192
chain : base ,
189
193
rpcUrl : null ,
@@ -214,22 +218,32 @@ describe('OnchainKitProvider', () => {
214
218
theme : 'default' ,
215
219
} ,
216
220
paymaster : null ,
221
+ wallet : {
222
+ display : 'classic' ,
223
+ termsUrl : undefined ,
224
+ privacyUrl : undefined ,
225
+ } ,
217
226
} ,
218
227
} ) ,
219
228
) ;
220
229
} ) ;
221
230
} ) ;
222
231
223
- it ( 'should use default values for appearance when config is provided' , async ( ) => {
232
+ it ( 'should use custom values when override in config is provided' , async ( ) => {
224
233
const customConfig = {
225
- appearance : { } ,
234
+ appearance : {
235
+ name : 'custom name' ,
236
+ logo : 'https://example.com/logo.png' ,
237
+ } ,
238
+ paymaster : 'https://example.com' ,
226
239
} ;
227
240
228
241
render (
229
242
< WagmiProvider config = { mockConfig } >
230
243
< QueryClientProvider client = { queryClient } >
231
244
< OnchainKitProvider
232
245
chain = { base }
246
+ schemaId = { schemaId }
233
247
apiKey = { apiKey }
234
248
config = { customConfig }
235
249
>
@@ -247,28 +261,33 @@ describe('OnchainKitProvider', () => {
247
261
chain : base ,
248
262
config : {
249
263
appearance : {
250
- logo : appLogo ,
251
- name : appName ,
264
+ name : 'custom name' ,
265
+ logo : 'https://example.com/logo.png' ,
252
266
mode : 'auto' ,
253
267
theme : 'default' ,
254
268
} ,
255
- paymaster : paymasterUrl ,
269
+ paymaster : 'https://example.com' ,
270
+ wallet : {
271
+ display : 'classic' ,
272
+ termsUrl : undefined ,
273
+ privacyUrl : undefined ,
274
+ } ,
256
275
} ,
257
276
projectId : null ,
258
277
rpcUrl : null ,
259
- schemaId : COINBASE_VERIFIED_ACCOUNT_SCHEMA_ID ,
278
+ schemaId : schemaId ,
260
279
} ) ,
261
280
) ;
262
281
} ) ;
263
282
} ) ;
264
283
265
- it ( 'should use custom values when override in config is provided' , async ( ) => {
284
+ it ( 'should use custom wallet config when provided' , async ( ) => {
266
285
const customConfig = {
267
- appearance : {
268
- name : 'custom name' ,
269
- logo : 'https://example.com/logo.png' ,
286
+ wallet : {
287
+ display : 'modal' ,
288
+ termsUrl : 'https://example.com/terms' ,
289
+ privacyUrl : 'https://example.com/privacy' ,
270
290
} ,
271
- paymaster : 'https://example.com' ,
272
291
} ;
273
292
274
293
render (
@@ -277,7 +296,6 @@ describe('OnchainKitProvider', () => {
277
296
< OnchainKitProvider
278
297
chain = { base }
279
298
schemaId = { schemaId }
280
- apiKey = { apiKey }
281
299
config = { customConfig }
282
300
>
283
301
< TestComponent />
@@ -289,21 +307,13 @@ describe('OnchainKitProvider', () => {
289
307
await waitFor ( ( ) => {
290
308
expect ( setOnchainKitConfig ) . toHaveBeenCalledWith (
291
309
expect . objectContaining ( {
292
- address : null ,
293
- apiKey : apiKey ,
294
- chain : base ,
295
- config : {
296
- appearance : {
297
- name : 'custom name' ,
298
- logo : 'https://example.com/logo.png' ,
299
- mode : 'auto' ,
300
- theme : 'default' ,
310
+ config : expect . objectContaining ( {
311
+ wallet : {
312
+ display : 'modal' ,
313
+ termsUrl : 'https://example.com/terms' ,
314
+ privacyUrl : 'https://example.com/privacy' ,
301
315
} ,
302
- paymaster : 'https://example.com' ,
303
- } ,
304
- projectId : null ,
305
- rpcUrl : null ,
306
- schemaId : schemaId ,
316
+ } ) ,
307
317
} ) ,
308
318
) ;
309
319
} ) ;
0 commit comments