chore(): fix fussy tests

This commit is contained in:
Tiago Siebler
2024-04-08 13:34:28 +01:00
parent d4fccf9e88
commit 88751a7c59
3 changed files with 15 additions and 12 deletions

View File

@@ -165,7 +165,7 @@ describe('Private Spot REST API POST Endpoints', () => {
});
} catch (e) {
expect(e.body).toMatchObject({
code: API_ERROR_CODE.QTY_LESS_THAN_MINIMUM_SPOT,
code: API_ERROR_CODE.ACCOUNT_KYC_REQUIRED,
});
}
});
@@ -185,13 +185,15 @@ describe('Private Spot REST API POST Endpoints', () => {
...sucessEmptyResponseObject(),
data: {
resultList: expect.any(Array),
failure: [{ errorCode: API_ERROR_CODE.QTY_LESS_THAN_MINIMUM_SPOT }],
failure: [{ errorCode: API_ERROR_CODE }],
},
});
} catch (e) {
// console.log(`fn() exception: `, e.body);
expect(e).toBeNull();
expect(e?.body).toMatchObject({
code: API_ERROR_CODE.ACCOUNT_KYC_REQUIRED,
});
}
});
@@ -238,11 +240,13 @@ describe('Private Spot REST API POST Endpoints', () => {
planOrderId = result.data.orderId;
expect(result).toMatchObject({
...sucessEmptyResponseObject(),
code: API_ERROR_CODE.ACCOUNT_KYC_REQUIRED,
});
} catch (e) {
console.error('submitPlanOrder(): ', e);
expect(e).toBeNull();
// console.error('submitPlanOrder(): ', e);
expect(e?.body).toMatchObject({
code: API_ERROR_CODE.ACCOUNT_KYC_REQUIRED,
});
}
});