fix(tests): more unit tests

This commit is contained in:
Javi
2020-11-06 10:44:46 +01:00
parent c7e08378ac
commit fd0f64fe54
35 changed files with 429 additions and 22 deletions

View File

@@ -1,6 +1,7 @@
import requests from '../../fixtures/requests'
import responses from '../../fixtures/responses'
import {assertResultMatch, TestSuite} from '../../utils'
const instructionsWithMaxLedgerVersionOffset = {maxLedgerVersionOffset: 100}
/**
* Every test suite exports their tests in the default object.
@@ -8,11 +9,25 @@ import {assertResultMatch, TestSuite} from '../../utils'
* - Check out "test/api/index.ts" for more information about the test runner.
*/
export default <TestSuite>{
prepareCheckCancel: async (api, address) => {
'prepareCheckCancel': async (api, address) => {
const result = await api.prepareCheckCancel(
address,
requests.prepareCheckCancel.normal
)
assertResultMatch(result, responses.prepareCheckCancel.normal, 'prepare')
},
'with ticket': async (api, address) => {
const localInstructions = {
...instructionsWithMaxLedgerVersionOffset,
maxFee: '0.000012',
ticketSequence: 23
}
const result = await api.prepareCheckCancel(
address,
requests.prepareCheckCancel.normal,
localInstructions
)
assertResultMatch(result, responses.prepareCheckCancel.ticket, 'prepare')
}
}