Skip to content

Commit

Permalink
fix: solana switch network test
Browse files Browse the repository at this point in the history
  • Loading branch information
enesozturk committed Apr 22, 2024
1 parent d97fbc7 commit dc369df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ export function SolanaWriteContractTest() {
}

return (
<Button isDisabled={loading} data-testid="sign-message-button" onClick={onIncrementCounter}>
<Button
isDisabled={loading}
data-testid="increment-counter-with-sign-button"
onClick={onIncrementCounter}
>
Increment Counter With Sign
</Button>
)
Expand Down
6 changes: 4 additions & 2 deletions apps/laboratory/tests/wallet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ testConnectedMW(
testConnectedMW(
'it should switch networks and sign',
async ({ modalPage, walletPage, modalValidator, walletValidator }) => {
const chains = modalPage.library === 'solana' ? ['Solana'] : ['Polygon', 'Ethereum']
const chains = modalPage.library === 'solana' ? ['Solana Devnet'] : ['Polygon', 'Ethereum']

// Run them one after another
async function processChain(index: number) {
Expand All @@ -50,11 +50,13 @@ testConnectedMW(
}

const chainName = chains[index] ?? DEFAULT_CHAIN_NAME
// For Solana, even though we switch to Solana Devnet, the chain name on the wallet page is still Solana
const chainNameOnWalletPage = modalPage.library === 'solana' ? 'Solana' : chainName
await modalPage.switchNetwork(chainName)
await modalValidator.expectNetwork(chainName)
await modalPage.closeModal()
await modalPage.sign()
await walletValidator.expectReceivedSign({ chainName })
await walletValidator.expectReceivedSign({ chainName: chainNameOnWalletPage })
await walletPage.handleRequest({ accept: true })
await modalValidator.expectAcceptedSign()

Expand Down

0 comments on commit dc369df

Please sign in to comment.