@@ -152,6 +152,48 @@ extensionTest(
152152 }
153153)
154154
155+ extensionTest (
156+ 'it should connect with email on Ethereum, switch to a different chain and be able to switch account type on Ethereum' ,
157+ async ( ) => {
158+ const mailsacApiKey = process . env [ 'MAILSAC_API_KEY' ]
159+ if ( ! mailsacApiKey ) {
160+ throw new Error ( 'MAILSAC_API_KEY is not set' )
161+ }
162+
163+ const email = new Email ( mailsacApiKey )
164+ await modalPage . emailFlow ( {
165+ emailAddress : await email . getEmailAddressToUse ( ) ,
166+ context : modalPage . page . context ( ) ,
167+ mailsacApiKey,
168+ clickConnectButton : true
169+ } )
170+ await modalValidator . expectConnected ( )
171+
172+ const emailEthAddress = ( await modalPage . page
173+ . getByTestId ( 'w3m-address' )
174+ . textContent ( ) ) as string
175+
176+ await modalPage . switchNetwork ( 'Solana' , true )
177+ await modalPage . closeModal ( )
178+ await modalValidator . expectConnected ( )
179+ await modalValidator . expectNetworkButton ( 'Solana' )
180+ await modalPage . openProfileWalletsView ( )
181+ await modalPage . clickTab ( 'evm' )
182+ await modalPage . switchAccount ( )
183+ await modalPage . closeModal ( )
184+ await modalValidator . expectConnected ( )
185+ await modalValidator . expectNetworkButton ( 'Ethereum' )
186+ await modalPage . openProfileWalletsView ( )
187+ await modalPage . clickTab ( 'evm' )
188+ await modalPage . switchAccount ( )
189+ await modalPage . closeModal ( )
190+ await modalValidator . expectAccountButtonAddress ( emailEthAddress )
191+ await modalPage . openProfileWalletsView ( )
192+ await modalPage . clickProfileWalletsMoreButton ( )
193+ await modalPage . disconnect ( false )
194+ }
195+ )
196+
155197extensionTest ( 'it should be disconnected after page refresh' , async ( ) => {
156198 await modalPage . page . reload ( )
157199 await modalValidator . expectDisconnected ( )
0 commit comments