@@ -19,6 +19,21 @@ describe('IExecWeb3mail()', () => {
1919 expect ( web3mail ) . toBeInstanceOf ( IExecWeb3mail ) ;
2020 } ) ;
2121
22+ it ( 'should verify Arbitrum Sepolia configuration is properly defined' , ( ) => {
23+ const arbitrumSepoliaConfig = getChainDefaultConfig ( 421614 , { allowExperimentalNetworks : true } ) ;
24+ expect ( arbitrumSepoliaConfig ) . not . toBeNull ( ) ;
25+
26+ // Verify all required fields are present
27+ expect ( arbitrumSepoliaConfig ! . name ) . toBe ( 'arbitrum-sepolia-testnet' ) ;
28+ expect ( arbitrumSepoliaConfig ! . dappAddress ) . toBe ( 'web3mail.apps.iexec.eth' ) ;
29+ expect ( arbitrumSepoliaConfig ! . prodWorkerpoolAddress ) . toBe ( '0x39c3cdd91a7f1c4ed59108a9da4e79de9a1c1b59' ) ;
30+ expect ( arbitrumSepoliaConfig ! . dataProtectorSubgraph ) . toBe ( 'https://thegraph.iex.ec/subgraphs/name/bellecour/dataprotector-v2' ) ;
31+ expect ( arbitrumSepoliaConfig ! . ipfsGateway ) . toBe ( 'https://ipfs-gateway.arbitrum-sepolia-testnet.iex.ec' ) ;
32+ expect ( arbitrumSepoliaConfig ! . ipfsUploadUrl ) . toBe ( 'https://ipfs-upload.arbitrum-sepolia-testnet.iex.ec' ) ;
33+ expect ( arbitrumSepoliaConfig ! . whitelistSmartContract ) . toBe ( '0x781482C39CcE25546583EaC4957Fb7Bf04C277D2' ) ;
34+ expect ( arbitrumSepoliaConfig ! . isExperimental ) . toBe ( true ) ;
35+ } ) ;
36+
2237 it ( 'should use default ipfs gateway url when ipfsGateway is not provided' , async ( ) => {
2338 const wallet = Wallet . createRandom ( ) ;
2439 const web3mail = new IExecWeb3mail (
@@ -156,6 +171,49 @@ describe('IExecWeb3mail()', () => {
156171 await expect ( web3mail . init ( ) ) . resolves . toBeUndefined ( ) ;
157172 expect ( web3mail ) . toBeInstanceOf ( IExecWeb3mail ) ;
158173 } ) ;
174+
175+ it ( 'should use Arbitrum Sepolia default configuration' , async ( ) => {
176+ const web3mail = new IExecWeb3mail (
177+ experimentalNetworkSigner ,
178+ { allowExperimentalNetworks : true }
179+ ) ;
180+ await web3mail . init ( ) ;
181+
182+ const arbitrumSepoliaConfig = getChainDefaultConfig ( 421614 , { allowExperimentalNetworks : true } ) ;
183+ expect ( arbitrumSepoliaConfig ) . not . toBeNull ( ) ;
184+
185+ expect ( web3mail [ 'ipfsGateway' ] ) . toBe ( arbitrumSepoliaConfig ! . ipfsGateway ) ;
186+ expect ( web3mail [ 'ipfsNode' ] ) . toBe ( arbitrumSepoliaConfig ! . ipfsUploadUrl ) ;
187+ expect ( web3mail [ 'dappAddressOrENS' ] ) . toBe ( arbitrumSepoliaConfig ! . dappAddress ) ;
188+ expect ( web3mail [ 'dappWhitelistAddress' ] ) . toBe ( arbitrumSepoliaConfig ! . whitelistSmartContract . toLowerCase ( ) ) ;
189+ expect ( web3mail [ 'defaultWorkerpool' ] ) . toBe ( arbitrumSepoliaConfig ! . prodWorkerpoolAddress ) ;
190+ expect ( web3mail [ 'graphQLClient' ] [ 'url' ] ) . toBe ( arbitrumSepoliaConfig ! . dataProtectorSubgraph ) ;
191+ } ) ;
192+
193+ it ( 'should allow custom configuration override for Arbitrum Sepolia' , async ( ) => {
194+ const customIpfsGateway = 'https://custom-arbitrum-ipfs.com' ;
195+ const customDappAddress = 'custom.arbitrum.app.eth' ;
196+
197+ const web3mail = new IExecWeb3mail (
198+ experimentalNetworkSigner ,
199+ {
200+ allowExperimentalNetworks : true ,
201+ ipfsGateway : customIpfsGateway ,
202+ dappAddressOrENS : customDappAddress
203+ }
204+ ) ;
205+ await web3mail . init ( ) ;
206+
207+ expect ( web3mail [ 'ipfsGateway' ] ) . toBe ( customIpfsGateway ) ;
208+ expect ( web3mail [ 'dappAddressOrENS' ] ) . toBe ( customDappAddress ) ;
209+
210+ const arbitrumSepoliaConfig = getChainDefaultConfig ( 421614 , { allowExperimentalNetworks : true } ) ;
211+ expect ( arbitrumSepoliaConfig ) . not . toBeNull ( ) ;
212+ expect ( web3mail [ 'ipfsNode' ] ) . toBe ( arbitrumSepoliaConfig ! . ipfsUploadUrl ) ;
213+ expect ( web3mail [ 'dappWhitelistAddress' ] ) . toBe ( arbitrumSepoliaConfig ! . whitelistSmartContract . toLowerCase ( ) ) ;
214+ expect ( web3mail [ 'defaultWorkerpool' ] ) . toBe ( arbitrumSepoliaConfig ! . prodWorkerpoolAddress ) ;
215+ expect ( web3mail [ 'graphQLClient' ] [ 'url' ] ) . toBe ( arbitrumSepoliaConfig ! . dataProtectorSubgraph ) ;
216+ } ) ;
159217 } ) ;
160218 } ) ;
161219} ) ;
0 commit comments