chore(): fix tests with new api error codes

This commit is contained in:
Tiago Siebler
2023-08-29 11:17:31 +01:00
parent 27871bbfd9
commit 49b739fa5c
4 changed files with 13 additions and 7 deletions

View File

@@ -84,7 +84,6 @@ describe('Private Futures REST API POST Endpoints', () => {
data: {},
});
} catch (e) {
// console.log(`submitOrder() exception: `, e.body);
expect(e.body).toMatchObject({
// seems to be the new "insufficient balance" error, informed bitget on 7th feb
code: API_ERROR_CODE.QTY_GREATER_THAN_MAX_OPEN,
@@ -150,8 +149,9 @@ describe('Private Futures REST API POST Endpoints', () => {
data: {},
});
} catch (e) {
console.error('cancelAllOrders: ', e);
expect(e).toBeNull();
expect(e.body).toMatchObject({
code: API_ERROR_CODE.NO_ORDER_TO_CANCEL,
});
}
});
@@ -253,6 +253,7 @@ describe('Private Futures REST API POST Endpoints', () => {
holdSide: 'long',
planType: 'profit_plan',
triggerPrice: '50',
triggerType: 'market_price',
}),
).toMatchObject({
...sucessEmptyResponseObject(),
@@ -260,7 +261,7 @@ describe('Private Futures REST API POST Endpoints', () => {
});
} catch (e) {
expect(e.body).toMatchObject({
code: API_ERROR_CODE.FUTURES_POSITION_DIRECTION_EMPTY,
code: API_ERROR_CODE.FUTURES_INSUFFICIENT_POSITION_NO_TPSL,
});
}
});