add faucet test

This commit is contained in:
Denis Angell
2023-02-14 19:42:29 -05:00
parent 0787166f6a
commit ffe93d0462

View File

@@ -65,6 +65,17 @@ describe('Get Faucet host ', function () {
)
})
it('returns the Vala host', function () {
const expectedFaucet = FaucetNetwork.Vala
// @ts-expect-error Intentionally modifying private data for test
testContext.client.connection.url = FaucetNetwork.Vala
assert.strictEqual(
getFaucetHost(testContext.client as Client),
expectedFaucet,
)
})
it('returns the correct faucetPath for Devnet host', function () {
const expectedFaucetPath = FaucetNetworkPaths[FaucetNetwork.Devnet]
// @ts-expect-error Intentionally modifying private data for test
@@ -87,6 +98,17 @@ describe('Get Faucet host ', function () {
)
})
it('returns the correct faucetPath for Vala host', function () {
const expectedFaucetPath = FaucetNetworkPaths[FaucetNetwork.Vala]
// @ts-expect-error Intentionally modifying private data for test
testContext.client.connection.url = FaucetNetwork.Vala
assert.strictEqual(
getDefaultFaucetPath(getFaucetHost(testContext.client as Client)),
expectedFaucetPath,
)
})
it('returns the correct faucetPath for undefined host', function () {
const expectedFaucetPath = '/accounts'