add extra tests for spot v3 signature issue (#187)
This commit is contained in:
@@ -12,10 +12,10 @@ export function successResponseList(successMsg: string | null = 'OK') {
|
|||||||
|
|
||||||
export function successResponseListV3() {
|
export function successResponseListV3() {
|
||||||
return {
|
return {
|
||||||
|
...successEmptyResponseObjectV3(),
|
||||||
result: {
|
result: {
|
||||||
list: expect.any(Array),
|
list: expect.any(Array),
|
||||||
},
|
},
|
||||||
...successEmptyResponseObjectV3(),
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,8 +36,8 @@ export function successResponseObjectV3() {
|
|||||||
|
|
||||||
export function successEmptyResponseObjectV3() {
|
export function successEmptyResponseObjectV3() {
|
||||||
return {
|
return {
|
||||||
retCode: API_ERROR_CODE.SUCCESS,
|
|
||||||
retMsg: expect.stringMatching(SUCCESS_MSG_REGEX),
|
retMsg: expect.stringMatching(SUCCESS_MSG_REGEX),
|
||||||
|
retCode: API_ERROR_CODE.SUCCESS,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,28 @@ describe('Private Spot REST API GET Endpoints', () => {
|
|||||||
expect(await api.getOpenOrders()).toMatchObject(successResponseListV3());
|
expect(await api.getOpenOrders()).toMatchObject(successResponseListV3());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('getOpenOrders() with symbol', async () => {
|
||||||
|
expect(await api.getOpenOrders(symbol)).toMatchObject(
|
||||||
|
successResponseListV3()
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('getOpenOrders() with order category', async () => {
|
||||||
|
const orderId = undefined;
|
||||||
|
const ordersPerPage = undefined;
|
||||||
|
|
||||||
|
// all these should succeed
|
||||||
|
expect(
|
||||||
|
await api.getOpenOrders(symbol, orderId, ordersPerPage)
|
||||||
|
).toMatchObject(successResponseListV3());
|
||||||
|
expect(
|
||||||
|
await api.getOpenOrders(symbol, orderId, ordersPerPage, 0)
|
||||||
|
).toMatchObject(successResponseListV3());
|
||||||
|
expect(
|
||||||
|
await api.getOpenOrders(symbol, orderId, ordersPerPage, 1)
|
||||||
|
).toMatchObject(successResponseListV3());
|
||||||
|
});
|
||||||
|
|
||||||
it('getPastOrders()', async () => {
|
it('getPastOrders()', async () => {
|
||||||
expect(await api.getPastOrders()).toMatchObject(successResponseListV3());
|
expect(await api.getPastOrders()).toMatchObject(successResponseListV3());
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user