fix payment-fault test case (only drop deposit responses)
This commit is contained in:
parent
a8ac8d2925
commit
8fe6cff297
@ -146,8 +146,7 @@ export async function runPaymentFaultTest(t: GlobalTestState) {
|
|||||||
|
|
||||||
// Check balance
|
// Check balance
|
||||||
|
|
||||||
const balApiResp = await wallet.apiRequest("getBalances", {});
|
await wallet.getBalances();
|
||||||
t.assertTrue(balApiResp.type === "response");
|
|
||||||
|
|
||||||
// Set up order.
|
// Set up order.
|
||||||
|
|
||||||
@ -182,6 +181,9 @@ export async function runPaymentFaultTest(t: GlobalTestState) {
|
|||||||
let faultCount = 0;
|
let faultCount = 0;
|
||||||
faultyExchange.faultProxy.addFault({
|
faultyExchange.faultProxy.addFault({
|
||||||
modifyResponse(ctx: FaultInjectionResponseContext) {
|
modifyResponse(ctx: FaultInjectionResponseContext) {
|
||||||
|
if (!ctx.request.requestUrl.endsWith("/deposit")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (faultCount < 3) {
|
if (faultCount < 3) {
|
||||||
faultCount++;
|
faultCount++;
|
||||||
ctx.dropResponse = true;
|
ctx.dropResponse = true;
|
||||||
@ -195,7 +197,6 @@ export async function runPaymentFaultTest(t: GlobalTestState) {
|
|||||||
// FIXME: should be validated, don't cast!
|
// FIXME: should be validated, don't cast!
|
||||||
proposalId: proposalId,
|
proposalId: proposalId,
|
||||||
});
|
});
|
||||||
t.assertTrue(apiResp.type === "error");
|
|
||||||
|
|
||||||
await wallet.runUntilDone();
|
await wallet.runUntilDone();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user