Skip to content

Commit df4ac4e

Browse files
committed
test(laboratory): cover multichain WalletConnect SIWX
1 parent 5bf1d5a commit df4ac4e

4 files changed

Lines changed: 27 additions & 4 deletions

File tree

apps/laboratory/src/constants/appKitConfigs.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,8 @@ export const appKitConfigs = {
385385
// ----- Custom Variants ------------------------------
386386
'siwx-default': {
387387
...commonAppKitConfig,
388-
adapters: ['ethers', 'solana', 'bitcoin', 'tron'],
388+
wagmiConfig: commonWagmiConfig,
389+
adapters: ['wagmi', 'solana', 'bitcoin', 'tron'],
389390
networks: ConstantsUtil.AllNetworks,
390391
siwx: new DefaultSIWX()
391392
},

apps/laboratory/src/utils/DataUtil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export const siwxSdkOptions: SdkOption[] = [
233233
title: 'Default SIWX',
234234
link: '/appkit?name=siwx-default',
235235
description:
236-
'Multichain SIWX configuration with Ethers, Solana and Bitcoin adapters enabled for AppKit'
236+
'Multichain SIWX configuration with Wagmi, Solana, Bitcoin and Tron adapters enabled for AppKit'
237237
}
238238
]
239239

apps/laboratory/tests/shared/utils/project.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ const SINGLE_ADAPTER_EVM_TESTS = [
9090
'flag-enable-reconnect.spec.ts'
9191
]
9292

93+
const SINGLE_ADAPTER_WAGMI_TESTS = [...SINGLE_ADAPTER_EVM_TESTS, 'siwx-walletconnect.spec.ts']
94+
9395
const CORE_TESTS = ['sign-client.spec.ts', 'universal-provider.spec.ts', 'core.spec.ts']
9496

9597
const SINGLE_ADAPTER_MOBILE_TESTS = ['mobile-wallet-features.spec.ts']
@@ -131,6 +133,7 @@ function createRegex(tests: string[], isDesktop = true) {
131133
}
132134

133135
const SINGLE_ADAPTER_EVM_TESTS_REGEX = createRegex(SINGLE_ADAPTER_EVM_TESTS)
136+
const SINGLE_ADAPTER_WAGMI_TESTS_REGEX = createRegex(SINGLE_ADAPTER_WAGMI_TESTS)
134137
const SINGLE_ADAPTER_SOLANA_TESTS_REGEX = createRegex(SINGLE_ADAPTER_SOLANA_TESTS)
135138
const SINGLE_ADAPTER_BITCOIN_TESTS_REGEX = createRegex(SINGLE_ADAPTER_BITCOIN_TESTS)
136139
const SINGLE_ADAPTER_TON_TESTS_REGEX = createRegex(SINGLE_ADAPTER_TON_TESTS)
@@ -166,11 +169,11 @@ const customProjectProperties: CustomProjectProperties = {
166169
testIgnore: /reown-authentication.*\.spec\.ts/u
167170
},
168171
'Desktop Chrome/wagmi': {
169-
testMatch: SINGLE_ADAPTER_EVM_TESTS_REGEX,
172+
testMatch: SINGLE_ADAPTER_WAGMI_TESTS_REGEX,
170173
testIgnore: /reown-authentication.*\.spec\.ts/u
171174
},
172175
'Desktop Firefox/wagmi': {
173-
testMatch: SINGLE_ADAPTER_EVM_TESTS_REGEX,
176+
testMatch: SINGLE_ADAPTER_WAGMI_TESTS_REGEX,
174177
testIgnore: /reown-authentication.*\.spec\.ts/u
175178
},
176179
'Desktop Chrome/bitcoin': {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { WalletPage } from '@reown/appkit-testing'
2+
3+
import { timingFixture } from './shared/fixtures/timing-fixture'
4+
import { ModalPage } from './shared/pages/ModalPage'
5+
import { ModalValidator } from './shared/validators/ModalValidator'
6+
7+
const test = timingFixture
8+
9+
test('signs SIWX over a multichain WalletConnect session', async ({ context, page }) => {
10+
const modal = new ModalPage(page, 'wagmi', 'siwx')
11+
const wallet = new WalletPage(await context.newPage())
12+
const validator = new ModalValidator(page)
13+
14+
await modal.load()
15+
await modal.qrCodeFlow(modal, wallet)
16+
await modal.promptSiwe()
17+
await wallet.handleRequest({ accept: true })
18+
await validator.expectConnected()
19+
})

0 commit comments

Comments
 (0)