fix payment-fault test case (only drop deposit responses)

This commit is contained in:
Florian Dold 2021-02-05 11:56:17 +01:00
parent a8ac8d2925
commit 8fe6cff297
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -146,8 +146,7 @@ export async function runPaymentFaultTest(t: GlobalTestState) {
// Check balance
const balApiResp = await wallet.apiRequest("getBalances", {});
t.assertTrue(balApiResp.type === "response");
await wallet.getBalances();
// Set up order.
@ -182,6 +181,9 @@ export async function runPaymentFaultTest(t: GlobalTestState) {
let faultCount = 0;
faultyExchange.faultProxy.addFault({
modifyResponse(ctx: FaultInjectionResponseContext) {
if (!ctx.request.requestUrl.endsWith("/deposit")) {
return;
}
if (faultCount < 3) {
faultCount++;
ctx.dropResponse = true;
@ -195,7 +197,6 @@ export async function runPaymentFaultTest(t: GlobalTestState) {
// FIXME: should be validated, don't cast!
proposalId: proposalId,
});
t.assertTrue(apiResp.type === "error");
await wallet.runUntilDone();