custom faucet hosts and various typing fixes for NFT support that were originally missed (#1882)

* various typing fixes for NFT support that were originally missed

* add optional faucet URL to fundWallet

* run docgen and commit changes

* fixes integration tests
This commit is contained in:
ledhed2222
2022-01-24 13:08:35 -05:00
committed by GitHub
parent d9089b9c1f
commit 4f035fd0d6
163 changed files with 1285 additions and 1182 deletions

View File

@@ -3,35 +3,35 @@ import { assert } from 'chai'
import { _private } from '../../src/Wallet/fundWallet'
import { setupClient, teardownClient } from '../setupClient'
const { FaucetNetwork, getFaucetUrl } = _private
const { FaucetNetwork, getFaucetHost } = _private
describe('Get Faucet URL', function () {
describe('Get Faucet host ', function () {
beforeEach(setupClient)
afterEach(teardownClient)
it('returns the Devnet URL', function () {
it('returns the Devnet host', function () {
const expectedFaucet = FaucetNetwork.Devnet
this.client.connection.url = FaucetNetwork.Devnet
assert.strictEqual(getFaucetUrl(this.client), expectedFaucet)
assert.strictEqual(getFaucetHost(this.client), expectedFaucet)
})
it('returns the Testnet URL', function () {
it('returns the Testnet host', function () {
const expectedFaucet = FaucetNetwork.Testnet
this.client.connection.url = FaucetNetwork.Testnet
assert.strictEqual(getFaucetUrl(this.client), expectedFaucet)
assert.strictEqual(getFaucetHost(this.client), expectedFaucet)
})
it('returns the Testnet URL with the XRPL Labs server', function () {
it('returns the Testnet host with the XRPL Labs server', function () {
const expectedFaucet = FaucetNetwork.Testnet
this.client.connection.url = 'wss://testnet.xrpl-labs.com'
assert.strictEqual(getFaucetUrl(this.client), expectedFaucet)
assert.strictEqual(getFaucetHost(this.client), expectedFaucet)
})
it('returns undefined if not a Testnet or Devnet server URL', function () {
// Info: setupClient.setup creates a connection to 'localhost'
assert.throws(() => getFaucetUrl(this.client))
assert.throws(() => getFaucetHost(this.client))
})
})