Skip to content

Commit

Permalink
fix sui tests
Browse files Browse the repository at this point in the history
  • Loading branch information
awojciak committed Aug 10, 2023
1 parent f6843f3 commit bd76932
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
1 change: 0 additions & 1 deletion sdk/apps/polkadot/src/e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ describe('Base Client tests', () => {
)

expect(verify.isValid).toBeTruthy()
client.removeListener('signTransactions')
})
test('#getPendingRequests()', async () => {
client.removeListener('signTransactions')
Expand Down
21 changes: 11 additions & 10 deletions sdk/apps/sui/src/e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,8 @@ describe('SUI client tests', () => {
chain: 'sui:testnet'
})
})
test('#on("appDisconnected")', async () => {
const disconnecFn = vi.fn()
client.on('appDisconnected', async () => {
disconnecFn()
})
app.base.ws.terminate()
app.base.ws.close()
await smartDelay()
expect(disconnecFn).toHaveBeenCalledOnce()
})
test('#getPendingRequests()', async () => {
client.removeListener('signTransactions')
const tx = new TransactionBlock()
const coin = tx.splitCoins(tx.gas, [tx.pure(100)])
tx.transferObjects([coin], tx.pure(RECEIVER_SUI_ADDRESS))
Expand All @@ -190,4 +181,14 @@ describe('SUI client tests', () => {
const payload1 = requests[0] as SignTransactionsSuiRequest
expect(payload1.transactions.length).toBe(1)
})
test('#on("appDisconnected")', async () => {
const disconnecFn = vi.fn()
client.on('appDisconnected', async () => {
disconnecFn()
})
app.base.ws.terminate()
app.base.ws.close()
await smartDelay()
expect(disconnecFn).toHaveBeenCalledOnce()
})
})

0 comments on commit bd76932

Please sign in to comment.