From 2a93f85f415df0ef2a1c62bdb6213cb97b12cd1f Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Fri, 24 Sep 2021 09:57:54 -0400 Subject: [PATCH] test: integration tests for DepositPreauth (#1648) --- .../transactions/depositPreauth.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/integration/transactions/depositPreauth.ts diff --git a/test/integration/transactions/depositPreauth.ts b/test/integration/transactions/depositPreauth.ts new file mode 100644 index 00000000..89b282d2 --- /dev/null +++ b/test/integration/transactions/depositPreauth.ts @@ -0,0 +1,29 @@ +import _ from 'lodash' + +import { DepositPreauth, Wallet } from 'xrpl-local' + +import serverUrl from '../serverUrl' +import { setupClient, suiteClientSetup, teardownClient } from '../setup' +import { fundAccount, testTransaction } from '../utils' + +// how long before each test case times out +const TIMEOUT = 20000 + +describe('DepositPreauth', function () { + this.timeout(TIMEOUT) + + before(suiteClientSetup) + beforeEach(_.partial(setupClient, serverUrl)) + afterEach(teardownClient) + + it('base', async function () { + const wallet2 = Wallet.generate() + fundAccount(this.client, wallet2) + const tx: DepositPreauth = { + TransactionType: 'DepositPreauth', + Account: this.wallet.getClassicAddress(), + Authorize: wallet2.getClassicAddress(), + } + await testTransaction(this.client, tx, this.wallet) + }) +})